optimization of a function using optiminzation toolbox commands

1 次查看(过去 30 天)
Hello,I have built a function in the code shown bellow.The function is plotted as follows.
my goal is to lower the lobe at X=-22 from -7.4 to -15 without changing the rest of the plot.
For that i need to optimize real_voltage and phases vectors.
Is there a matlab function which could use maybe "genetic algorithm" to get me values of real_voltage and phases vectors which would produce such result?
Thanks.
clear all
clc
amplitude_norm_V=[1,1,1,1,1,1,1,1];
x=sqrt(1/(sum(amplitude_norm_V.^2)));
real_voltage=amplitude_norm_V.*x;
real_power=(real_voltage.^2);
sum(real_power);
phases=[0,0,0,0,0,0,0,0]
phases = 1×8
0 0 0 0 0 0 0 0
theta=linspace(-pi/2,pi/2,1000);
theta_0=pi*((0)/180);
f=5.6;
N=10;
lambda=300/f;
k=(2*pi)/lambda;
d=0.8*lambda;
total=0;
tot=0;
delta=k*d*sin(theta_0);
for z=1:8
AF=real_voltage(z)*exp(1i*(phases(z)/180*pi))*exp(-1i*(z-1)*(k*d*sin(theta)+delta));
total=total+AF;
end
plot((theta/pi)*180,20*log10(total));
Warning: Imaginary parts of complex X and/or Y arguments ignored.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by