Error using fcnchk (line 106) FUN must be a function, a valid string expression, or an inline function object. Error in fminsearch (line 162) funfcn = fcnchk(funfcn,length(varargin));
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,i'm new,it's urgent!
i have this problem: i created a function
function [ q ] = minimizza_x_tau(tc);
load('datinuovi.mat')
fsamp=50;
N=length(Datitermocoppia) ;
t=[0:1/fsamp:N/fsamp-1/fsamp];
salto=max(Datitermocoppia)-min(Datitermocoppia);
y=salto.*(1-exp(-t./tc));
y2=rot90(y);
diffe=(Datitermocoppia-y2).^2;
q=sum(diffe);
end
when i call the function from the script for example with
tc=2;
[taunew]=minimizza_x_tau(tc);
it works, but it is not i have to do.
i have to do a minimization as it:
tc=2;
[q]=fminsearch(minimizza_x_tau(tc),0.24);
If i do that it says me ERRORS above.
you know why? i don't know if put tc=2 is right i put them for example.
thank you
Respuestas (1)
Matt J
el 1 de Jun. de 2016
You need to pass a handle to the objective function
[q]=fminsearch(@minimizza_x_tau,0.24);
0 comentarios
Ver también
Categorías
Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!