How to divide the cell array content into columns?

2 ビュー (過去 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 Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by