Plotting within a nested for loop
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
nathan stallworth
el 8 de Abr. de 2021
Editada: nathan stallworth
el 13 de Ag. de 2021
Hey there,
I am attempting to plot multiple pieces of data into one plot, I have changed around the position of the 'hold on' and 'hold off' many times (before the for loop, in the middle...etc). And it still produces 2 seperate plots (tempV2 = 2). Not sure what is the issue, using vectors and proper syntax.
Thank you,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/576737/image.jpeg)
0 comentarios
Respuesta aceptada
VBBV
el 8 de Abr. de 2021
%if true
fig4 = figure()
Comment the above line in the loop. It produces a seperate figure window each time in loop
5 comentarios
VBBV
el 8 de Abr. de 2021
%if true
for i = 1:tempv2
x(i) = your code
y(i) = your code
z(i) = your code
scatter3(x(1:i),y(1:i),z(1:i),'filled')
...%rest of code
....
end
Try the above changes mentioned
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations 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!