필터 지우기
필터 지우기

Plots in a loop

조회 수: 2 (최근 30일)
Teshome Kumsa
Teshome Kumsa 2022년 7월 13일
답변: Star Strider 2022년 7월 13일
Assume I had a matrix of dimension nX20. I want to plot each column using a loop, but there is some problem in giving a title for each plot in a loop. I want to give the titles data1, data2 and so on for each plot. My loop looks like this:
figure(k)
surf(squeeze(X),squeeze(Y),reshape(data(:,k),size(squeeze(X))),'edgecolor','none')
view(2)
axis equal
axis tight
set(gcf,'renderer','painters')
title('data')
colorbar
end

답변 (1개)

Star Strider
Star Strider 2022년 7월 13일
Perhaps:
title(sprintf('data %3d',k))
.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by