Asked by Abdessami Jalled
on 17 Sep 2019

Let H1 = Span_IR{(1; 0; 0; 0; 0; 0); (0; 1; 0; 0; 0; 0)}

H2 = Span_IR{(0; 0; 1; 0; 0; 0); (0; 0; 0; 1; 0; 0)}

H3 = Span_IR{(0; 0; 0; 0; 1; 0); (0; 0; 0; 0; 0; 1)}

H4 = Span_IR{(1; 0; 1; 0; 1; 0); (0; 1; 0; 1; 0; 1)}

i want to find two vectors (x1,x2,x3,x4,x5,x6) and (y1,y2,y3,y4,y5,y6) such that

H= span{(x1,x2,x3,x4,x5,x6) ,(y1,y2,y3,y4,y5,y6)} and

SpanR(Hi ;Hj ;H ) = R^6. where i,j in {1,2,3,4}.

so we have six matrixs that must not be zero . every matrix is composed by the two vector (x1,x2,x3,x4,x5,x6) and (y1,y2,y3,y4,y5,y6) and 4 vectors among the eight vectors of H1, H2 H3 and H4.

for example

A1 = [1 0 0 0 x1 y1;0 1 0 0 x2 y2;0 0 1 0 x3 y3;0 0 0 1 x4 y4;0 0 0 0 x5 y5;0 0 0 0 x6 y6] then DET(A) must be non zero.

hope this is clear.

Answer by Bruno Luong
on 18 Sep 2019

Edited by Bruno Luong
on 18 Sep 2019

Accepted Answer

A8 = [1 0 0 0 0 0 1 0;

0 1 0 0 0 0 0 1;

0 0 1 0 0 0 1 0;

0 0 0 1 0 0 0 1 ;

0 0 0 0 1 0 1 0;

0 0 0 0 0 1 0 1]

ij=nchoosek(1:4,2);

binaryflag = true; % put it TRUE if you want X and Y binary, even if it's not stated in the question

% This method is O(1) for binaryflag = false

while true

if binaryflag

H = rand(6,2) > 0.5;

else

H = randn(6,2);

H = H ./ sqrt(sum(H.^2,1));

end

for k=1:size(ij,1)

i=ij(k,1);

j=ij(k,2);

Hi = A8(:,2*i+(-1:0));

Hj = A8(:,2*j+(-1:0));

A = [Hi,Hj,H];

d = eigs(A,1,'smallestabs');

OK = abs(d) >= 1e-12;

if ~OK

% for binaryflag=FALSE, likely never get here !

% fprintf('detect possible singularity\n');

break

end

end

if OK

% for binaryflag=FALSE likely get here the first iteration

break;

end

end

X = H(:,1)

Y = H(:,2)

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 8 Comments

## Bruno Luong (view profile)

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/480812-find-a-column-vector-such-that-the-determinant-of-a-matrix-a-is-non-zero#comment_746924

## Abdessami Jalled (view profile)

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/480812-find-a-column-vector-such-that-the-determinant-of-a-matrix-a-is-non-zero#comment_746947

## Bruno Luong (view profile)

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/480812-find-a-column-vector-such-that-the-determinant-of-a-matrix-a-is-non-zero#comment_747014

## John D'Errico (view profile)

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/480812-find-a-column-vector-such-that-the-determinant-of-a-matrix-a-is-non-zero#comment_747016

## Abdessami Jalled (view profile)

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/480812-find-a-column-vector-such-that-the-determinant-of-a-matrix-a-is-non-zero#comment_747367

## Bruno Luong (view profile)

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/480812-find-a-column-vector-such-that-the-determinant-of-a-matrix-a-is-non-zero#comment_747381

## Abdessami Jalled (view profile)

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/480812-find-a-column-vector-such-that-the-determinant-of-a-matrix-a-is-non-zero#comment_747410

## Bruno Luong (view profile)

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/480812-find-a-column-vector-such-that-the-determinant-of-a-matrix-a-is-non-zero#comment_747634

Sign in to comment.