Borrar filtros
Borrar filtros

How to change plotted graph's line?

1 visualización (últimos 30 días)
Ali Deniz
Ali Deniz el 10 de Oct. de 2022
Comentada: Ali Deniz el 10 de Oct. de 2022
I have two matrices which are 200*5 and 201*5. I want to plot a graph from these two matrices. as X component is from the one, Y component is from the other. I have an algoritm below. When I select the line as a star (*), it is plotted but I want it as a line. How can I do it? Thank you.
%for plotting
[row col]=size(Vdt);
for m=1:col
for n=1:row-1
hold on
plot(t(n,m),Vdt(n,m),"*")
end
end

Respuesta aceptada

the cyclist
the cyclist el 10 de Oct. de 2022
Editada: the cyclist el 10 de Oct. de 2022
If you leave the marker symbol off, the plot command will default to using a solid line with no symbol. You can also just explicitly specify a solid line with no symbol:
plot(t(n,m),Vdt(n,m),"-")
You can read more in the documentation for the plot function, in particular this example (and ones following) from that same page.
  7 comentarios
Steven Lord
Steven Lord el 10 de Oct. de 2022
Another possibility, if the points are generated one at a time, is to use some of the animation techniques available in MATLAB, like creating an animatedline and using addpoints to add points to the line as they are calculated or creating a normal line with line or plot and adding values to the line's XData and YData properties as they're calculated.
Ali Deniz
Ali Deniz el 10 de Oct. de 2022
That's good idea also. Thank you.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by