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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by