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

2 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

dpb
dpb am 12 Aug. 2019
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 Kommentare
Sven F. Biebricher
Sven F. Biebricher am 12 Aug. 2019
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 am 12 Aug. 2019
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'};

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Export finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by