I have the following code:
startDate=datetime('03-Oct-2014','InputFormat','dd-MMM-yyyy');
endDate=datetime('15-Oct-2014','InputFormat','dd-MMM-yyyy');
start_end_time = endDate-startDate;
start_end_time_days = days(start_end_time);
When I try to set title on the plot like this:
Ticker = 'SPY';
title([Ticker, ' Bought in ', char(start_end_time_days), ' days before some event']);
I get an empty string: SPY Bought in days before some event
I experimented with the code removing char() and doing like:
title([Ticker, ' Bought in ', start_end_time_days, ' days before some event']);
though it didn't help either.
댓글 수: 2
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/249280-inserting-date-and-time-variables-into-graphs-title#comment_317020
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/249280-inserting-date-and-time-variables-into-graphs-title#comment_317020
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/249280-inserting-date-and-time-variables-into-graphs-title#comment_317199
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/249280-inserting-date-and-time-variables-into-graphs-title#comment_317199
댓글을 달려면 로그인하십시오.