How can I plot 2 vectors of different length?
Mostrar comentarios más antiguos
Hello everyone
It could be the question sounds stupid, but I have 32 data (which correspond to averages of 9 measurements) and I want to plot along aprox 50 days
(Because there weren´t measurements some days)
Anyone has an idea of how can I do that? I was thinking by scatter, but appears the same error (different lenghts)
Thank u
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 12 de Jun. de 2019
1 voto
You know which days had valid measurements. Pass the time coordinate corresponding to those days as the "x" coordinate to plot, if you want a line plot that draws between the missing data.
stem() plot might make sense in some cases.
It is possible to draw in segments. For that purpose, pass in nan as the y coordinates for the missing measurements, and be sure to include a marker type. You want the marker because you might have patterns such as NaN Point NaN and plot() will only draw a line when there are at least two finite points in a row.
1 comentario
Jonathan Bijman
el 12 de Jun. de 2019
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!