use for loop to write a sum function to achieve halfsum

 採用された回答

Stephan
Stephan 2019 年 1 月 28 日

0 投票

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 ExchangeLoops 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