Extracting data from vector

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

回答 (1 件)

jonas
jonas 2020 年 9 月 16 日

0 投票

sum(NUM(NUM>5))

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

タグ

質問済み:

2020 年 9 月 16 日

回答済み:

2020 年 9 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by