필터 지우기
필터 지우기

Changing a word in chart title in loop

조회 수: 3 (최근 30일)
Rohit shaw
Rohit shaw 2021년 12월 18일
댓글: Rohit shaw 2021년 12월 18일
Hello everyone,
I am creating 58 graphs in a loop, however I want to change a particular word in the chart title in the loop. That word is saved in a 1x58 cell array i.e. there are 58 names in 58 cells. Therefore, the stock title is ''Global change in 'here I want the names stored in the cell'''. Could anyone help me here?
Thank you in anticipation.

채택된 답변

Matt J
Matt J 2021년 12월 18일
for i=1:58
title("Global change in"+yourCell{i})
end
  댓글 수: 3
Matt J
Matt J 2021년 12월 18일
Did you try it? We can do so right here.
yourCell={'Temperature','Humidity'};
for i=1:numel(yourCell)
figure(i); plot(1:5)
title("Global change in "+yourCell{i});
end
Rohit shaw
Rohit shaw 2021년 12월 18일
Thank you Matt for showing this. Its clear now.
Thank you for time.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by