Time vector using stairs
2 views (last 30 days)
Show older comments
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 Comment
Answers (1)
Peter Perkins
on 8 May 2017
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 Comments
See Also
Categories
Find more on Language Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!