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

조회 수: 5 (최근 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 CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by