plot does not display anything using hold on

3 views (last 30 days)
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.

Answers (1)

Sriram Tadavarty
Sriram Tadavarty on 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

Categories

Find more on Specifying Target for Graphics Output in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!