how to create recursive title
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
DwiNY
am 18 Mär. 2020
Bearbeitet: John D'Errico
am 18 Mär. 2020
How to create a recursive title. I plan to have many (do loop) plot, where I would like to have a dynamic title, where the "loni" and "lati" changing.
I.e. loni =94.98 and lati=0.25 I have encounter error, due to not sure where I put the '
Thank you
Dwi
eval(['title ( '' Equatorial Pacific : Lon:' loni ' E Lat:' lati ' N);'''])
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 18 Mär. 2020
Bearbeitet: John D'Errico
am 18 Mär. 2020
Slow down. This has absolutely nothing to do with recusrsion. Next, there is absolutely no need to use eval. You are making things WAY too complicated.
You want to create a title that looks like this:
Equatorial Pacific : Lon: 94.98 E Lat: 0.25 N
Given inputs of lati and loni as variables. So, first, can you create that string? You could do so as simply as this:
titlstr = ['Equatorial Pacific : Lon: ',num2str(loni),' E Lat: ',num2str(lati),' N'];
Then just call title using that input.
title(titlestr)
As simple as those two lines. There is nothing remotely recursive about it, nor is there any need for eval.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Title finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!