Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Can I update the units/properties of a time table using the head function?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Instead of listing off each variable unit,
TT.Properties.VariableUnits = {'','C','kW','kW','Auxiliary','Auxiliary','Auxiliary','W','W','C'};
I am trying to grab each unit from the first header grabbed
Units = head(TT,1)
^^ then implement that into the variablunits??
Something is off on my end.
3 Commenti
Star Strider
il 23 Lug 2020
The first row of the ‘TT’ table is likely data, do you can do anything with them that you want to (within limits).
If you want to change the variable names or units, you can address them individually (since they are cell arrays) to change any one or more of them. You would have to use the appropriate ‘TT.Properties.’ structure regardless.
Risposte (1)
Cris LaPierre
il 23 Lug 2020
If you are asking if MATLAB can automatically extract units from the column name (e.g. Time (mins)), the answer is no. You would have to write the code yourself to separate the two and then add the units to the table property.
You can set up your data file in a way that would allow MATLAB to read in your units automatically. The units would need to be on their own row. You would then need to set up import options by telling it which row contains the units. See here (for a spreadsheet).
0 Commenti
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!