I tried to run this function in matlab to minimize measured data and simulation from equations and I got this message: input argument is undefined ??? Can anyone tell what the correct syntax is.
Rich (BB code):
function Ap = insertionlossnew(x)
L1 = 3;
x(1)=Zcd1;
L2 = 24;
x(2)=Zcb;
L3=3;
x(3)=Zcd2;
Ap=zeros(1,15);
for v =[1 4 8 10 16 20 25 31.25 62.5 100 200 250 300 400 500];
Ap = (v*((L1)*(Zcd1)+(L2)*(Zcb)+(L3)*(Zcd2)));
Am=[20.3 23.4 24.6 25.3 23.4 26.4 27.5 22.9 23.7 29.8 31.3 32.8 27.9 25.8 35.6];
end
Y1=sqrt(sum(Ap-Am)^2);
Y2=mean(Am);
Y3=sqrt(sum(Am-Y2)^2);
Y4=Y1/Y3;
Y=(1-Y4)*100;
disp(Y);
Last edited by a moderator: