Hello , I am working on a project where i need to optimize a set of values before starting my algorithm, I have never used optimization before , I read some courses about it but i still have a problem formulating my problem , I need to minimize the error function( sum of squared difference ) SSD= norm( lE1l –lAl)^2 where A is my objective result , and E1 depends on E0 (E0 is the matrix I need to change) ; my constraints are : E1 = ifft(fft( (lE0l.* exp(-1j*phase(E0).*sqrt( K0² - Kx² - Ky²)*z1)))) ; K0 is a constant , Kx and Ky are a matrix of ‘coordinates’ . and the values I need to change are lE0l and phase(E0) . is my constraint formulated correctly? I will use genetic algorithm in matlab optimization toolbox . the size of the E1 matrix is 2048*2048 while the E0 matrix is 101*101, how can I specify that to reduce the calculations and time used? Any help will be appreciated,thank you in advance.