Creating multiple Line plot

3 visualizaciones (últimos 30 días)
Jonathan Asante
Jonathan Asante el 27 de Mzo. de 2018
Comentada: Star Strider el 28 de Mzo. de 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

Respuesta aceptada

Star Strider
Star Strider el 27 de Mzo. de 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 comentarios
Jonathan Asante
Jonathan Asante el 28 de Mzo. de 2018
Awesome. Many thanks.
Star Strider
Star Strider el 28 de Mzo. de 2018
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by