plot does not display anything using hold on

5 Ansichten (letzte 30 Tage)
dekel vered
dekel vered am 30 Jul. 2020
Beantwortet: Sriram Tadavarty am 30 Jul. 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.

Antworten (1)

Sriram Tadavarty
Sriram Tadavarty am 30 Jul. 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

Kategorien

Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by