Undefined function or variable 'retime'

I am trying to use the retime command on a timetable I imported from Excel, but I keep getting this error. I am using R2018a, the function was introduced in 2016a, and the Add-On Manager shows it under the generic Matlab installation, which is obviously present. Another search result from the Add-On Manager shows the function as contained in the Financial Toolbox, which is also installed. Any idea why I cannot access the function? Running
which -all retime
returns
/Applications/MATLAB_R2018a.app/toolbox/matlab/datatypes/@timetable/retime.m % timetable method
but I cannot access it. Thoughts?

5 件のコメント

Kojiro Saito
Kojiro Saito 2018 年 8 月 15 日
Just typing retime gives an error "Undefined function or variable 'retime'." Could you try this simple example and confirm whether it works?
Alessandro Fascetti
Alessandro Fascetti 2018 年 8 月 15 日
I can confirm it does provide me with the same error.
Star Strider
Star Strider 2018 年 8 月 15 日
Please post the relevant parts of your code, and ideally also your Excel file.
Alessandro Fascetti
Alessandro Fascetti 2018 年 8 月 15 日
The example simply gives the same error at line 15:
TT2 = retime(TT,'hourly','spline')
Undefined function or variable 'retime'
Greg
Greg 2018 年 9 月 12 日
Is it possible your classdef of timetable is overloaded or shadowed? Try running and posting the results of these 2 commands:
which timetable -all
methods(TT)
Also, have you confirmed that this problem persists across MATLAB sessions?

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

回答 (1 件)

Steven Lord
Steven Lord 2018 年 9 月 12 日

0 投票

In addition to the other suggestions you've already been given, check whether the TT variable is a timetable (for which retime is defined) or a table (for which it is not.)
Depending on how you're importing your data (with readtable?) you may need to convert it from a table to a timetable using table2timetable before calling retime on it.

カテゴリ

ヘルプ センター および File ExchangeTables についてさらに検索

製品

リリース

R2018a

タグ

質問済み:

2018 年 8 月 15 日

回答済み:

2018 年 9 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by