Hello
i have a cell array that i want to sum the coulmns ;
A={ 1x2 double , 1x2 double
1x2 double , 1x2 double
1x2 double , 1x2 double
1x2 double , 1x2 double }

 採用された回答

KSSV
KSSV 2019 年 5 月 7 日

0 投票

A = cell(4,2) ;
for i = 1:4
for j = 1:2
A{i,j} = rand(1,2) ;
end
end
B = cellfun(@sum,A)

1 件のコメント

masoud jiryaei
masoud jiryaei 2019 年 5 月 10 日
Thank you so much;
It was usefull.

サインインしてコメントする。

その他の回答 (1 件)

madhan ravi
madhan ravi 2019 年 5 月 7 日

0 投票

sum(cat(1,A{:}),2)

1 件のコメント

masoud jiryaei
masoud jiryaei 2019 年 5 月 10 日
Thanks
it was great.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Mathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by