how to sum elements of a cell array

조회 수: 20 (최근 30일)
mohamed Faraj
mohamed Faraj 2019년 8월 14일
답변: madhan ravi 2019년 8월 14일
I have a cell array V={[1;2;3;4],[5;6;7;8]}, I want to do a summation as follows [1+5;2+6;3+7;4+8]. I need the result to be in a matrix. Thank you

채택된 답변

madhan ravi
madhan ravi 2019년 8월 14일
sum(cat(3,V{:}),3)

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by