필터 지우기
필터 지우기

How to divide the cell array content into columns?

조회 수: 3 (최근 30일)
farzad
farzad 2020년 4월 19일
댓글: farzad 2020년 4월 20일
Hi all
I want to write the maximums of a matrix column into table and then Excel.
I do
C = {max(mo(:,2:7))}
Tit = cell2table(C,'VariableNames',{'maxTz','maxTy','maxTx','maxRz','maxRy','maxRx'})
if f1==1
Tout=[Tit]
else
Tout = [Tout;Tit]
end
but the variable C looks like this from what I do :
C =
1×1 cell array
{1×6 double}
so I get an error :
Error: The VariableNames property must contain one name for each variable in the table.
How to I write the C with 6 columns ?

채택된 답변

Stephen23
Stephen23 2020년 4월 20일
You don't need the cell array, it would be simpler with array2table:
M = max(mo(:,2:7));
Tit = array2table(M,...)
  댓글 수: 1
farzad
farzad 2020년 4월 20일
Tank you very much. Why did you write (M,...)?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by