Set Properties​.VariableC​ontinuity to a single column in a timetable?

3 ビュー (過去 30 日間)
Sven F. Biebricher
Sven F. Biebricher 2019 年 8 月 12 日
コメント済み: dpb 2019 年 8 月 12 日
Hi,
I tried to set the Properties.VariableContinuity for a single column in my timetable. This is neccesary, as I have a modular code and the size (and especcialy the order of columns) are changing. I tried it the following way:
dataTable.Properties.VariableContinuity{'room_t'} = 'continuous';
I allways get the following error:
"Brace indexing is not supported for variables of this type."
Do you have any idea?
Sven

採用された回答

dpb
dpb 2019 年 8 月 12 日
Per the documentation, ". This property can be an empty array, which is the default. If the array is not empty, then the number of elements must equal the number of variables."
You can't set just one column, you must define a cell array of the size of the timetable number of variables and assign that...see the doc for example.
dataTable.Properties.VariableContinuity = {'continuous', ...};
would be the syntax where the RHS cellstr matches your timetable. Use 'unset' for all other variables you don't want/need to set specifically.
  2 件のコメント
Sven F. Biebricher
Sven F. Biebricher 2019 年 8 月 12 日
Thanks for your quick answer. I will try that, but I have to build a little workarround as the size of the table and the position of the named columns is changing.
dpb
dpb 2019 年 8 月 12 日
OK, just did something similar the other day in another answer. Find the right column using the
dataTable.Properties.VariableContinuity=repmat({'unset'},1,size(dataTable,2));
dataTable.Properties.VariableContinuity(contains(TT.Properties.VariableNames,'room_t'))={'continuous'};

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by