I have 2D plot,how shall I make it look like a 3D like a view from top.

1 view (last 30 days)
x = linspace(0,10);
y1 = sin(x);
y2 = sin(5*x);
How to to make these 2 plots comes one after another with a view from top.
The code generates 2 subplots along XY direction,how shall I rotate it to view from top like a spectrum case.I know have to include Z,but what is the basis for Z ( like saying amplitude vs time what's Z that time) to make it plot3()

Accepted Answer

Ameer Hamza
Ameer Hamza on 16 Sep 2020
Are you trying to get something like this
f = figure();
ax = axes();
view(ax, 3);
grid(ax, 'on');
x = linspace(0, 10);
y1 = sin(x);
y2 = sin(5*x);
plot3(x, y1, 1*ones(size(x)));
plot3(x, y2, 2*ones(size(x)));

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!