필터 지우기
필터 지우기

How to sum matrix value?

조회 수: 1 (최근 30일)
KoolMU
KoolMU 2015년 5월 9일
편집: KoolMU 2018년 2월 9일
I need to sum value in matrix but I can't use "sum". So, Can I sum value in matrix with if-else or while loop? How to create it. Assume I have matrix C=[ 1 2 3 4 5 6 7 8 9 ]
Thank You
  댓글 수: 1
the cyclist
the cyclist 2015년 5월 9일
Because you "can't use sum", I assume this homework. Show what you've tried so far, and maybe we can give you some hints.

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

답변 (1개)

Image Analyst
Image Analyst 2015년 5월 9일
Yes. You can use a while loop, or a for loop. I don't see how an if could be used. See this, and if you have trouble creating the code read this If it's homework, please add the tag "homework" and if it's not homework, say so explicitly.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by