How can I get the several sums by three interval of a matrix in matlab?

Réponses (2)

You don't need a loop to do that:
B=load('a.txt');
sum(B(B<5))
Example:
B = [1 2 8 6 4 5 9]
>> sum(B(B<5))
ans =
7

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Tags

Question posée :

le 10 Fév 2013

Community Treasure Hunt

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

Start Hunting!

Translated by