フィルターのクリア

Error time series plot: cannot perform numeric operation which have non numerical data

3 ビュー (過去 30 日間)
Hello everybody!
I had a table object that I transformed to timeseries. When it comes to plot it, I get an error... How can I solve this issue?
Thank you very much!
prova4 = timeseries(mmean1416_pt); %1x1 table timeseries, in which time is categorical in the form Jan-2014
plot(prova4)
Error using timeseries/plot (line 47)
Cannot perform numeric operations on timeseries which have non-numeric data

採用された回答

Walter Roberson
Walter Roberson 2021 年 6 月 24 日
When you use timeseries() on a table object, then timeseries() does not look inside the table at the variables. It creates times 0:(rows-1) (seconds) where rows is the number of rows in the table. And the data associated with the time is the entire table row.
But table rows are not numeric, they are table() objects. And table() objects cannot be plotted.
If you have a table object that has a time field, you should consider creating a timetable(). There is no plot() for timetable objects, but you can access the Time property and whatever variable is appropriate.
Caution: If your times are categorical, then you have to be careful in how you construct the categorical in order to impose a sorting order and associated position values. Probably easier to datetime() with a 'convertfrom' to convert the categorical text into datetimes.
  7 件のコメント
CARLOTTA DENTICO
CARLOTTA DENTICO 2021 年 6 月 25 日
an error again :(((
Error using timetable (line 470)
Row times must be datetime or duration vector.
Walter Roberson
Walter Roberson 2021 年 6 月 25 日
What is the first entry in ts1416theta.Time ? Your comments earlier indicated it encodes 01-Jan-2014 00:30:00 but what is its class() and how does it show up when you display it?

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by