フィルターのクリア

array operation in matlab

1 回表示 (過去 30 日間)
ali hassan
ali hassan 2022 年 2 月 14 日
編集済み: Matt J 2022 年 2 月 14 日
if i have type cell:
a=['hi' 'lo' 'hi'];
b=['lo' 'hi' 'hi'];
how can i find total number of times when there is 'hi' in a and 'hi' in b as well?

採用された回答

Matt J
Matt J 2022 年 2 月 14 日
編集済み: Matt J 2022 年 2 月 14 日
a={'hi' 'lo' 'hi'};
b={'lo' 'hi' 'hi'};
nnz(string(a)=="hi" & string(b)=="hi")
ans = 1

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by