Creating multiple Line plot

3 visualizzazioni (ultimi 30 giorni)
Jonathan Asante
Jonathan Asante il 27 Mar 2018
Commentato: Star Strider il 28 Mar 2018
I've got a 5 x 6 matrix and would like to create multiple line plots using the first 1 column as x-axis and 2 column as y-axis and the other four as the values of z on the graph. Any help will be appreciated.
1 0 10 15 0 15
2 0.5 10 10 0 20
3 0.6 6 24 0 11
4 0.8 0 29 0 11
5 3 0 19 11 10

Risposta accettata

Star Strider
Star Strider il 27 Mar 2018
Try this:
A = [1 0 10 15 0 15
2 0.5 10 10 0 20
3 0.6 6 24 0 11
4 0.8 0 29 0 11
5 3 0 19 11 10];
AxesH = axes('NextPlot', 'add');
figure(1)
for k1 = 1:4
plot3(A(:,1), A(:,2), A(:,k1+2))
end
grid on
view(-60, 30)
Experiment with the view function arguments to get the result you want.
  2 Commenti
Jonathan Asante
Jonathan Asante il 28 Mar 2018
Awesome. Many thanks.
Star Strider
Star Strider il 28 Mar 2018
As always, my pleasure.

Accedi per commentare.

Più risposte (0)

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