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

4 visualizaciones (últimos 30 días)
Keigo
Keigo el 11 de Oct. de 2022
Editada: Atsushi Ueno el 11 de Oct. de 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の部分を縦一列に表記

Respuesta aceptada

Atsushi Ueno
Atsushi Ueno el 11 de Oct. de 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

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!