use for loop to write a sum function to achieve halfsum

 Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange

Tag

Richiesto:

il 28 Gen 2019

Risposto:

il 28 Gen 2019

Community Treasure Hunt

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

Start Hunting!

Translated by