필터 지우기
필터 지우기

plot does not display anything using hold on

조회 수: 1 (최근 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 CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by