Find random samples of some rows in the matrix and ensure the rank

1 回表示 (過去 30 日間)
NA
NA 2021 年 4 月 30 日
編集済み: NA 2021 年 5 月 2 日
I have a matrix 'A':
A = [ 1.2285 -1.2285 2.3433e-17 -4.1658e-17
0.70827 -0.70827 1.351e-17 -2.4017e-17
-1.2285 1.2285 -4.1658e-17 5.9885e-17
-1.8226e-17 4.1658e-17 1.0932 -1.1271
-2.4017e-17 2.4017e-17 0.63025 -0.64979
-4.1658e-17 4.1658e-17 -1.161 1.1948
0 0 1.1159 0
0 0 0 1.0901];
I want to find the random sample of some rows 'index' in matrix 'A' so that each sample A(index,:) ensure rank.

採用された回答

Matt J
Matt J 2021 年 5 月 1 日
編集済み: Matt J 2021 年 5 月 1 日
What does it mean to "ensure the rank"? Do you mean you want to find a random full-rank subset of rows? If so,
A = [ 1.2285 -1.2285 2.3433e-17 -4.1658e-17
0.70827 -0.70827 1.351e-17 -2.4017e-17
-1.2285 1.2285 -4.1658e-17 5.9885e-17
-1.8226e-17 4.1658e-17 1.0932 -1.1271
-2.4017e-17 2.4017e-17 0.63025 -0.64979
-4.1658e-17 4.1658e-17 -1.161 1.1948
0 0 1.1159 0
0 0 0 1.0901];
M=size(A,1);
N=rank(A);
B=[];
while rank(B)<N
index=randperm(M,N);
B=A(index,:);
end
index=sort(index),
index = 1×3
3 5 8
B=A(index,:)
B = 3×4
-1.2285 1.2285 -0.0000 0.0000 -0.0000 0.0000 0.6302 -0.6498 0 0 0 1.0901
  1 件のコメント
NA
NA 2021 年 5 月 1 日
編集済み: NA 2021 年 5 月 2 日
Do you mean you want to find a random full-rank subset of rows?
I mean, a heuristic search to avoid non-observable set.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by