行列から0~0.01​となる要素を抽出して​、別の行列として定義​したいです。

5 vues (au cours des 30 derniers jours)
Keigo
Keigo le 11 Oct 2022
Modifié(e) : Atsushi Ueno le 11 Oct 2022
行列から0~0.01となる要素を抽出して、別の行列として定義したいのですが、うまく表現が出来ません。
rssimW = [0.0016,0.3981,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0000,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0040,0.0040,0.0040,0.0040,0.0063,0.0040,0.0040,0.0040,0.0040,0.0040,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0000,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0016,0.0025,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0016,0.0016,0.0025,0.0000,0.0016,0.0025,0.0016,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0040,0.0025,0.0025,0.0040,0.0025,0.0016,0.0016,0.0063,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0000,0.0016,0.0025,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0063,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0016,0.0025,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0025,0.0025,0.0025,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0016,0.3981,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0000,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0016,0.0016,0.0025,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025]';
B=0~0.01の部分を縦一列に表記

Réponse acceptée

Atsushi Ueno
Atsushi Ueno le 11 Oct 2022
rssimW = [0.0016,0.3981,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0000,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0040,0.0040,0.0040,0.0040,0.0063,0.0040,0.0040,0.0040,0.0040,0.0040,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0000,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0016,0.0025,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0016,0.0016,0.0025,0.0000,0.0016,0.0025,0.0016,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0025,0.0040,0.0025,0.0025,0.0040,0.0025,0.0016,0.0016,0.0063,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0000,0.0016,0.0025,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0063,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0025,0.0016,0.0025,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0025,0.0025,0.0016,0.0025,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0025,0.0025,0.0025,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0016,0.3981,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0016,0.0000,0.0025,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0025,0.0025,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025,0.0025,0.0016,0.0016,0.0016,0.0025,0.0016,0.0016,0.0025,0.0025,0.0025,0.0025]';
size(rssimW) % rssimWは313行1列のベクトル
ans = 1×2
313 1
B = rssimW(rssimW >= 0 & rssimW <= 0.01); % B=0~0.01の部分を縦一列に表記
size(B) % 条件を満たすベクトルは311行1列
ans = 1×2
311 1
rssimW(rssimW < 0 | rssimW > 0.01) % 条件外の数値は2個
ans = 2×1
0.3981 0.3981

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!