use for loop to write a sum function to achieve halfsum

 채택된 답변

Stephan
Stephan 2019년 1월 28일
Hi,
note the triu function:
A = [1 2 3; 4 5 6; 7 8 9]
result = sum(triu(A),'all')
Best regards
Stephan

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2019년 1월 28일

답변:

2019년 1월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by