Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MATLAB:problem with fminsearch

Status
Not open for further replies.

yannik33

Member level 1
Member level 1
Joined
Oct 18, 2011
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,507
What's wrong with my code?
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)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top