Sum Matrix excluding certain values

조회 수: 11 (최근 30일)
Li Chng
Li Chng 2019년 12월 4일
답변: Adam Danz 2019년 12월 4일
MatrixA = [1:10 ; 21:30 ; 8:17]
how to sum all the elements inside matrix A, if the element is greater than 3?

채택된 답변

Adam Danz
Adam Danz 2019년 12월 4일
y = sum(MatrixA(MatrixA > 3))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by