How to optimize the distance between a vector and a plane using genetic Algorithm in MATLAB

Hey,

I am trying to optimize the distance between a vector, ‘’b’’ of size 8*1 and a plane ‘’C’’. I initially have a Matrix A of size 8 *8, I want to create multiple planes by extracting all combinations of the columns in A, and thereby creating several planes/matrices denoted C with dim. Going form 10*2 to 10*8. By implementing all the possibilities of C in equation: z=b-C*pinv( C )*b

Several values of z is now obtained, z is the distance between the vector b and the planes C, I want to find the combination of columns in A that gives the smallest value of z i.e. the shortest distance.

A=[1 5 8 8 9 6 2 5

8 7 5 5 5 1 1 7

7 7 7 2 5 4 4 4

6 5 2 2 6 6 2 1

5 6 7 9 8 2 2 1

4 1 4 7 4 8 4 6

5 5 5 5 4 8 4 7

1 4 7 8 9 6 7 4]

b=[ 7

5

2

4

5

6

6

4]

Similar questions and discussions