how can i convert 2d plot in to 3d surface ??
古いコメントを表示
I have this small code that plots ogive shape nose in 2d.
I want to develop 3d surface from this code !!! please help and guide....
I am using surf command and tried to turn vector in to matrix....
L = 500;
R = 79;
n= 0.4;
x = 0:0.01:50;
y= R*(x/L).^n;
z= 1.*(x/L).^n;
plot(x,y,'r','linewidth',2)
hold on
plot(x,-y,'r','linewidth',2)
xlabel('Length')
ylabel('Radius')
title('Nose Profile')
axis('equal');
5 件のコメント
Walter Roberson
2024 年 4 月 25 日
For the third dimension, do you want change over L, or R, or n ?
John D'Errico
2024 年 4 月 25 日
編集済み: John D'Errico
2024 年 4 月 25 日
My wild guess is you want to find the rotational surface, inplied by a rotation around the axis of symmetry. At least that stems from your comment about a nose profile.
But there are multiple other ways you could create a surface from that curve. You could extend it along the third dimension, creating a surface of infinite extent in z. You could rotate it around some other axis, or around any general line.
Dr Sohaib Khan
2024 年 4 月 25 日
@Dr Sohaib Khan, As @Walter Roberson & @John D'Errico mentioned you could create multple surfaces depending on the which dimension is taken to rotate the 2D line plot. Since you dont want to change L, R, & n, you can use commands like surf or mesh as shown below
L = 500;
R = 79;
n= 0.4;
x = 0:0.01:50;
y = R*(x/L).^n;
z = 1.*(x/L).^n;
[X, Th] = meshgrid(linspace(1,50,100),linspace(0,2*pi,100));
Y = (R*(X/L).^n).*cos(Th);
Z = (1.*(X/L).^n).*sin(Th);
subplot(211)
plot(x,y,'r','linewidth',2)
hold on
plot(x,-y,'r','linewidth',2)
xlabel('Length')
ylabel('Radius')
title('Nose Profile')
axis([-10 50 -40 40]);
subplot(212)
s=surf(X,Y,Z);shading interp;view([30 15])
Dr Sohaib Khan
2024 年 4 月 28 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


