行列 一定範囲ごとに最小値を探す

2 views (last 30 days)
Yuto
Yuto on 14 Dec 2020
Commented: 源樹 上林 on 15 Dec 2020
1.2列目にはXY座標が,3列目には-180°から180°までの角度順の角度データが,4列目にはそれに対応した半径の値が格納された行列を作成しました.
A = [245 135 -180 200;245 164 -179.5 170; ~ ;246 170 180 120]
今回データ点数を絞る必要があり,元の行列から,例えば3列目の角度データを基準に,5°ずつの範囲内で最小の半径の行だけを抜き出した行列を作成したい場合に,どのような方法が最適なのでしょうか?
ご教示いただけますよう、よろしくお願いいたします。
  1 Comment
源樹 上林
源樹 上林 on 15 Dec 2020
例えば、-180~-175 °だとこう?
a = and( -180 <= A(:,3), A(:,3) < -175 );
[m, i] = min(A(a,4))
A(i, :)
あんまりすっきりしませんね。これだとループ回すことになりそうだし。
というかこういう解釈で合っていますか?

Sign in to comment.

Answers (0)

Categories

Find more on Matrix Indexing in Help Center and File Exchange

Tags

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!