using the same scale in the x and y directions, plot the shape of the airfoil from excel file in matlab

To plot the shape of an airfoil from an Excel file in MATLAB with the same scale in the x and y directions, you can follow these steps:

  1. Load the data from the Excel file into MATLAB using the "xlsread" function. For example:

    main.m
    [x, y] = xlsread('airfoil.xlsx');
    
    34 chars
    2 lines

    This assumes that the first column of the Excel file contains the x-coordinates and the second column contains the y-coordinates.

  2. Plot the airfoil using the "plot" function with the "axis equal" command to ensure that the x and y axes have the same scale. For example:

    main.m
    plot(x, y);
    axis equal;
    
    24 chars
    3 lines

    This will plot the airfoil using the x-coordinates as the horizontal axis and the y-coordinates as the vertical axis with the same scale.

Here's the complete code:

main.m
[x, y] = xlsread('airfoil.xlsx');
plot(x, y);
axis equal;
58 chars
4 lines

Make sure to replace "airfoil.xlsx" with the actual name of your Excel file.

related categories

gistlibby LogSnag