Time vector using stairs

2 ビュー (過去 30 日間)
Diana Arvidsson
Diana Arvidsson 2017 年 5 月 5 日
回答済み: Peter Perkins 2017 年 5 月 8 日
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 件のコメント
Jan
Jan 2017 年 5 月 5 日
Please post your code, if you want us to understand the source of the problem.

サインインしてコメントする。

回答 (1 件)

Peter Perkins
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)

カテゴリ

Help Center および File ExchangeLanguage Fundamentals についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by