data of corresponding column

1 回表示 (過去 30 日間)
farhah muhammad
farhah muhammad 2022 年 1 月 20 日
回答済み: KSSV 2022 年 1 月 20 日
HI,
I have many columns, I need to find corresponding data between two columns and summation from one column based on the condition of another column .
for example, the column A should be more than 600, then sum of the column B (based on the conditions in column A- more than 600).
thank you! really hope someone can help me out from this!

回答 (1 件)

KSSV
KSSV 2022 年 1 月 20 日
idx = columnA > 600 ;
iwant = sum(columnB(idx)) ;

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by