plot does not display anything using hold on

5 visualizaciones (últimos 30 días)
dekel vered
dekel vered el 30 de Jul. de 2020
Respondida: Sriram Tadavarty el 30 de Jul. de 2020
Hello
I try to plot inside a loop, using the hold on function.
this is my script:
figure;
for i = 1:128
for j = 1:128
for k=1:scans_amount
plot(TE(1:end),squeeze(pix_value_mat(i,j,k))); hold on;
end
end
end
and the figure does not show anything. I wanted to choose the default plot coloring so that every graph will be displayed in a different color.

Respuestas (1)

Sriram Tadavarty
Sriram Tadavarty el 30 de Jul. de 2020
Hi Dekel,
The way you are accessing pix_value_mat indicates it could be a scalar. If there a single value plotted over the values, then, the output will be blank. It would be good to know that the values or dimensions of TE and pix_value_mat.
You can try this,
plot(TE(1:end),squeeze(pix_value_mat(i,j,k)),'*'); hold on;
The above will confirm, if it is a scalar value that it is accessing in the plot.
Hope this helps.
Regards,
Sriram

Categorías

Más información sobre Specifying Target for Graphics Output 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