Modification of objective function for optimization without using matlab function

Dear all,
I am writting a code like
syms y, z
N=input('length of the data= ');
x = constellation(randi([1 4],1,N)); %QPSK data(constellation is already declared)
hr=(randn(1)+j*randn(1));
hr1=(randn(1)+j*randn(1));
r=z*(hr.*x+hr1.*y);
xt = x;
xt(2:2:end) = 0;
rr = r;
rr(1:2:end) = 0;
rl=6*rr+z*n; % n is random value
for ii=1:N
p(ii)= mean(norm(xt(ii)-rl(ii))^2);
end
c_3=sum(p);
obj=matlabFunction(c_3);
This code is running ,but I don't want to use matlabfunction. How I can write(modify) my objective function directly according to my code which will be useful for optimization ?
Thanks in advance

Risposte (0)

Richiesto:

il 30 Nov 2020

Modificato:

il 30 Nov 2020

Community Treasure Hunt

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

Start Hunting!

Translated by