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

1 visualizzazione (ultimi 30 giorni)
Ramesh Bala il 16 Set 2020
Commentato: Ramesh Bala il 16 Set 2020
subplot(2,1,1);
x = linspace(0,10);
y1 = sin(x);
plot(x,y1)
subplot(2,1,2);
y2 = sin(5*x);
plot(x,y2)
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()
0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Risposta accettata

Ameer Hamza il 16 Set 2020
Are you trying to get something like this
f = figure();
ax = axes();
hold(ax);
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)));
6 CommentiMostra 4 commenti meno recentiNascondi 4 commenti meno recenti
Ameer Hamza il 16 Set 2020
For waterfall()
f = figure();
ax = axes();
hold(ax);
view(ax, 3);
grid(ax, 'on');
xlim([0 10]);
ylim([0 5]);
zlim([-4 4])
x = linspace(0, 10);
z1 = sin(x);
z2 = 2*sin(3*x);
z3 = 3*sin(5*x);
z4 = 4*sin(7*x);
waterfall(x, [1 2 3 4], [z1; z2; z3; z4])
Ramesh Bala il 16 Set 2020
Thank you ,lemme try to check it

Accedi per commentare.

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by