Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Creating table with variablenames properts as an array
조회 수: 1 (최근 30일)
이전 댓글 표시
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?
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!