Extruding a 2D plot to 3D

6 ビュー (過去 30 日間)
Mahmoud Abbas
Mahmoud Abbas 2022 年 4 月 11 日
回答済み: Star Strider 2022 年 4 月 12 日
Hello, i want to make the code extrude this curve over the range 0 to 10 units into the z-axis and i want the plot to show it in 3D
i=1;
for k=-5:0.1:5
y(i)=k^2;
x(i)=k;
i=i+1;
end
plot(x,y)

採用された回答

Star Strider
Star Strider 2022 年 4 月 12 日
Try this —
k = -5:0.1:5;
y = k.^2;
figure
surf([k;k], [y;y], [ones(size(k))*10; zeros(size(k))])
grid on
colormap(turbo)
shading('interp')
axis('equal') % Optional
title('Rainbow!')
.

その他の回答 (1 件)

Tala
Tala 2022 年 4 月 12 日
Take a look at this
https://www.mathworks.com/matlabcentral/answers/82917-extend-line-plot-to-a-surface

カテゴリ

Help Center および File ExchangeExploration and Visualization についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by