plot does not display anything using hold on

3 ビュー (過去 30 日間)
dekel vered
dekel vered 2020 年 7 月 30 日
回答済み: Sriram Tadavarty 2020 年 7 月 30 日
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.

回答 (1 件)

Sriram Tadavarty
Sriram Tadavarty 2020 年 7 月 30 日
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

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by