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!