Set Properties.VariableContinuity to a single column in a timetable?
조회 수: 5 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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
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개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!