I want to see the text & strings in a single line of Xlabel
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2021년 3월 30일
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
추가 답변 (1개)
VBBV
2021년 3월 30일
%if true
xlabel(['Timeseries' num2str(timestamp(end-1)) 'to' num2str(timestamp(end))]);
Use num2str
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!