search minimum of a parameter function with the constrain that one parameter must be integer
Show older comments
Hi,
I'm looking for the minimum of sum((f(x)-data(x))^2), where f(x)= (sum(exp(1i .* x .* jz))).^2 where jz = 1,2,...nz and nz is my integer parameter and data(x). So f is function of x while (sum(f(x)-data(x)))^2 is function of nz.
I think I have to use fmincon, but I don't find the syntax to tell MatLab that the constrain is nz = integer.
I'm using this approach beacuse I wasn't able to use lsqcurvefit because when I run the summation to evaluate f(x) matlab doesn't understand tha f is function of x and gives an indexes error.
Many thanks
Gianluca
Accepted Answer
More Answers (1)
gianluca messina
on 31 May 2011
0 votes
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!