i would solve a linear equation system like this:
x_1*3+x_2*4+x_3*5+x_4*6+x_6*2=0
x_1*21+x_2*23+x_3*45+x_4*37*+x_6*0=0
x_1*340+x_2*24+x_3*25+x_4*31+x_6*0=0
x_1*32+x_2*45+x_3*5+x_4*6+x_7*2=0
x_1*9+x_2*11+x_3*13+x_4*49+x_7*0=0
x_1*5+x_2*88+x_3*100+x_4*102+X_7*2=0
[x_1][x_2][x_3] [x_4] [,5]
[1,] 3 4 5 6 2
[2,] 21 23 45 37 0
[3,] 340 24 25 31 0
[4,] 32 45 5 6 2
[5,] 9 11 13 49 0
[6,] 5 88 100 102 2
i use solve this linear homogeneous equation system with MASS::null(t(M),
but the problem is that find x_1....x_4, but x_5 find only one solution but i need different three value that is x_5,1,x_5,2 and x_5,3.
value of matrix are random, and they can be changed
Ok, had to reactivate my rusted linear algebra knowledge, you can do this by using the Singular Value Decomposition, if all elements of the diagonal part of the SVD are non zero, only the trivial solutions exists:
You can try the code with these matrices: