I want to see the text & strings in a single line of Xlabel
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
SA
am 30 Mär. 2021
Kommentiert: Star Strider
am 30 Mär. 2021
Hi,
I wish to see the text and string in a single line as
"Timeseries 2019-09-04T14:53:20 to 2019-09-04T15:10:00".
But I get the xlabel as 4 lines (4 different array) as
"Timeseries
2019-09-04T14:53:20
to
2019-09-04T15:10:00"
xlabel(['Timeseries' string(timestamp(end-1)) 'to' string(timestamp(end))]);
Can anybody pull me out from here? Thanks in advance
0 Kommentare
Akzeptierte Antwort
Star Strider
am 30 Mär. 2021
Try this:
timeseries = ['2019-09-04T14:53:20';'2019-09-04T15:10:00']; % Create Array
xlabel(sprintf("Timeseries %s to %s", string(timeseries(end-1:end,:))))
.
4 Kommentare
Weitere Antworten (1)
VBBV
am 30 Mär. 2021
%if true
xlabel(['Timeseries' num2str(timestamp(end-1)) 'to' num2str(timestamp(end))]);
Use num2str
Siehe auch
Kategorien
Mehr zu Data Type Conversion 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!