Extracting data from vector

2 vues (au cours des 30 derniers jours)
Elijah L
Elijah L le 16 Sep 2020
Réponse apportée : jonas le 16 Sep 2020
I have vector NUM = [-1 2 6 9 22 4 23 18] and I want to find all numbers that are greater than 5 and then add them all up. example: the answer is 78

Réponses (1)

jonas
jonas le 16 Sep 2020
sum(NUM(NUM>5))

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by