3d plotting help

4 ビュー (過去 30 日間)
Sean Smith
Sean Smith 2011 年 10 月 2 日
I am trying to plot this figure, an airplane wing but I can't seem to get it oriented right. This is the only way I could get it to plot but I want it facing me, not downward as it is now. So x is the x-axis, y is the z-axis, and z is the y-axis. Every time I change something I get an error. Please help. Thank you.
clear
c=1;
t=0.2;
x=linspace(0,c,100);
l=linspace(0,4,100);
y=t*c/0.2*(0.2969*sqrt(x/c)-0.1260*(x/c)-0.3516*(x/c).^2+0.2843*(x/c).^3-0.1015*(x/c).^4);
[X,Z]=meshgrid(x,l);
surf(X,y,Z);
hold on;
surf(X,-y,Z);
  2 件のコメント
Walter Roberson
Walter Roberson 2011 年 10 月 2 日
Things are easier with ndgrid() instead of meshgrid()
Sean Smith
Sean Smith 2011 年 10 月 2 日
i'm still having the same problems with ndgrid()

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 10 月 3 日
You know the definition of you x, y and z axis. If you want to swap axis, why don't you change the x,y,z symbol in your equation and re-generate the plot.
Or you can use view() to set the viewpoint.
Or you can use the "Rotate 3D" button on the figure to rotate the figure to what you want, and then use the view() to get the viewpoint.
Or I modified your code.
clear
c=1;
t=0.2;
y=linspace(0,c,100);
z=t*c/0.2*(0.2969*sqrt(y/c)-0.1260*(y/c)-0.3516*(y/c).^2+0.2843*(y/c).^3-0.1015*(y/c).^4);
x=y;
[X,Z]=meshgrid(x,z);
surf(x,y,Z);
hold on;
surf(x,y,-Z);
xlabel('x');ylabel('y');zlabel('z');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by