% サンプルデータ
A = [10, 25, 5, 40, 25, 30];
% 20以上の要素のインデックスを探す(複数ヒットする)
idx = find(A >= 20);
% 見つかった個数を確認する
count = numel(idx);
% 最初の結果だけを確認
first_idx = idx(1);
% 最後の結果だけを確認
last_idx = idx(end);
% 2番目の結果だけを確認
second_idx = idx(2);
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme