Filter löschen
Filter löschen

Changing a word in chart title in loop

3 Ansichten (letzte 30 Tage)
Rohit shaw
Rohit shaw am 18 Dez. 2021
Kommentiert: Rohit shaw am 18 Dez. 2021
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.

Akzeptierte Antwort

Matt J
Matt J am 18 Dez. 2021
for i=1:58
title("Global change in"+yourCell{i})
end
  3 Kommentare
Matt J
Matt J am 18 Dez. 2021
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 am 18 Dez. 2021
Thank you Matt for showing this. Its clear now.
Thank you for time.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by