removeconstantrows
定数値での行の削除による行列の処理
構文
[Y,PS] = removeconstantrows(X,max_range)
[Y,PS] = removeconstantrows(X,FP)
Y = removeconstantrows('apply',X,PS)
X = removeconstantrows('reverse',Y,PS)
説明
removeconstantrows
は、定数値で行を削除して行列を処理します。
[Y,PS] = removeconstantrows(X,max_range)
は、X
およびオプションのパラメーターを取ります。
X |
|
max_range | 削除する行の値の最大範囲 (既定は 0) |
これは、以下を返します。
Y |
|
PS | 値の一貫した処理を可能にする処理設定 |
[Y,PS] = removeconstantrows(X,FP)
は、struct としてパラメーター FP.max_range
を取ります。
Y = removeconstantrows('apply',X,PS)
は、X
と設定 PS
を指定すると、Y
を返します。
X = removeconstantrows('reverse',Y,PS)
は、Y
と設定 PS
を指定すると、X
を返します。
入力行列にある NaN
値はすべて欠損データとして扱われ、一意の値とはみなされません。そのため、たとえば、removeconstantrows
は行列 [1 1 1 NaN; 1 1 1 2]
の最初の行を削除します。
例
定数値をもつ行が削除されるように行列を構成します。
x1 = [1 2 4; 1 1 1; 3 2 2; 0 0 0]; [y1,PS] = removeconstantrows(x1);
y1 = 1 2 4 3 2 2 PS = max_range: 0 keep: [1 3] remove: [2 4] value: [2x1 double] xrows: 4 yrows: 2 constants: [2x1 double] no_change: 0
次に、新しい値に同じ処理設定を適用します。
x2 = [5 2 3; 1 1 1; 6 7 3; 0 0 0];
y2 = removeconstantrows('apply',x2,PS)
5 2 3 6 7 3
y1
の処理を逆にして、元の行列 x1
を取得します。
x1_again = removeconstantrows('reverse',y1,PS)
1 2 4 1 1 1 3 2 2 0 0 0
バージョン履歴
R2006a で導入
参考
fixunknowns
| mapminmax
| mapstd
| processpca