1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MATLAB findの結果が複数あった場合の確認方法

1
Posted at
% サンプルデータ
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);
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?