yannik33
Member level 1
What's wrong with my code?
It would be nice if someone could look at it,thx.
It would be nice if someone could look at it,thx.
Code:
clc;
clear;
global x y
file=load('daten.dat');
x=file(:,1);
y=file(:,2);
theta=[1 1];%to optimize
theta=fminsearch('Gue',theta)
Code:
function G=Gue(theta)
global x y
a=theta(1);
b=theta(2);
ym=@(x)(((a/((b+(a-b).*exp(-a.*x))))));
G=sum((ym-y).^2);
end
Undefined function or method
'minus' for input arguments of type
'function_handle'.
Error in ==> Gue at 8
G=sum((ym-y).^2);
Error in ==> fminsearch at 191
fv,1) = funfcn(x,varargin{:});
Error in ==> Labority5 at 25
theta=fminsearch('Gue',theta)