Time vector using stairs
2 ビュー (過去 30 日間)
古いコメントを表示
When I use the stairs function with a time vector I get the error message "Input arguments must be numeric.". Is it even possible to use a time vector (YYMMDD) together with the stairs function, and if so, how?
1 件のコメント
回答 (1 件)
Peter Perkins
2017 年 5 月 8 日
It's not clear what you have and what you're trying to do, but in R2016b and later:
>> strs = {'170101' '170102' '170103' '170104' '170105' '170106' '170107' '170108' '170109' '170110'};
>> d = datetime(strs,'InputFormat','yyMMdd')
d =
1×10 datetime array
Columns 1 through 9
01-Jan-2017 02-Jan-2017 03-Jan-2017 04-Jan-2017 05-Jan-2017 06-Jan-2017 07-Jan-2017 08-Jan-2017 09-Jan-2017
Column 10
10-Jan-2017
>> stairs(d,1:10)

0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!