The following code creates a cosecant squared radiation pattern. There is a phases and amplitude_norm_V vector which are the coefficients of AF expression. I am looking to create a GA iterative algorithm that given a known AF data will recreate phases and amplitude coefficients. I was given a link to a possible method shown below. How to implement it in matlab? Thanks. https://en.wikipedia.org/wiki/Least_mean_squares_filter#:%7E:text=Least%20mean%20squares%20(LMS)%20algorithms,desired%20and%20the%20actual%20signal

i wrote the matlab code
amplitude_norm_V=[0.3213,0.4336,0.7539,1,0.7817,0.3201,0.32,0.3261];
x=sqrt(1/(sum(amplitude_norm_V.^2)));
real_voltage=amplitude_norm_V.*x;
real_power=(real_voltage.^2);
sum(real_power);
phases=[129.9121,175.4215,-144.6394,-116.9071,-93.7603,-60.0165,55.2841,89.4477]
norm_phases=phases-175.4215;
theta=linspace(0,pi,1000);
theta_0=pi*(135.315/180);
f=5.6;
N=10;
lambda=300/f;
k=(2*pi)/lambda;
d=0.8*lambda;
total=0;
tot=0;
for z=1:8
total=total+AF;
tot=tot+AF.^2;
end
plot((theta/pi)*180,20*log10(total));