sum a column in a matrix

조회 수: 4 (최근 30일)
Berfin Çetinkaya
Berfin Çetinkaya 2022년 5월 13일
댓글: Berfin Çetinkaya 2022년 5월 15일
Hi guys
I have 20 matrices like in my photo. I want to sum the 7th column of each matrix. Then how can I print the values of the 20 matrices that I have collected for the 7th columns in a single column one after the other?

채택된 답변

Stephen23
Stephen23 2022년 5월 13일
F = @(t) sum(t{:,7});
V = cellfun(F,Tables)
  댓글 수: 3
Stephen23
Stephen23 2022년 5월 14일
"Can we convert it to a single column?"
V = V(:)
Berfin Çetinkaya
Berfin Çetinkaya 2022년 5월 15일
Thank you !

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by