Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Creating table with variablenames properts as an array

1 visualización (últimos 30 días)
Saeid
Saeid el 28 de Mayo de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I create a table of the form:
Temp={'T_'}
rpm=[70; 80; 90]
Temperature=strcat(Temp,num2str(rpm))
TVALz=[190 220 300 140; 57 164 215 210; 109 45 67 220]
OuTABLE=table(Temperature,TVALz)
Giving:
Temperature TVALz
___________ ________________________
'T_70' 190 220 300 140
'T_80' 57 164 215 210
'T_90' 109 45 67 220
What I need is to have 4 individual headers (e.g. T1, T3, T6, T9) instead of the header "TVALz", so that the result would like:
Temperature T1 T3 T6 T9
___________ ________________________
'T_70' 190 220 300 140
'T_80' 57 164 215 210
'T_90' 109 45 67 220
I tried this:
Temp={'T_'}
rpm=[70; 80; 90]
Temperature=strcat(Temp,num2str(rpm))
TVALz=[190 220 300 140; 57 164 215 210; 109 45 67 220]
VarNames={'T1' 'T3' 'T6' 'T9'}
OuTABLE=table(Temperature,TVALz,'VariableNames',VarNames)
but it produced the erro message:
"Error using table (line 322)
The VariableNames property must contain one name for each variable in the table."
What am i doing wrong?

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by