Hello,
I'm trying to use fmincon to minimize the error between a designed filter and physical data by manipulating the filter FSTOP, FPASS and order. The contraint is that all F are in increasing order. So I gave the following contraint:
x0=[Fstop1 Fpass1 Fpass2 Fstop2 flt_ord];% Inequalities
A=zeros(3,5); b=0*ones(3,1);A(1,1)=1;A(1,2)=-1; %x1<x2
A(2,2)=1;A(2,3)=-1; %x2<x3
A(3,3)=1;A(3,4)=-1; %x3<x4
then I run fmincon(@myfun,x0,A,b).
My problem is that for some reason, i get that the F's are not in ascending order, and the filter designer shows and error and stops the entire script.
What am I doing wrong ??
tnx, Sivan
Best Answer