575
Computer
- Aug 17, 2007
- 1
want to solve the following problem
Function:
function [f] = nyfil(x)
v=ones(50,1);
v=v*10;
B_t=v;
S_t=v;
M_t = min(B_t,S_t)+max(B_t,S_t)/2;
x_s = x(2)/(x(5)+x(2));
x_b = x(1)/(x(5)+x(1));
f= sum(x(1)-x(2)+M_t*(log(x_b)+log(x_s))) + S_t*log(x(5)+x(2)) + sum(log(x(4)*(1-x(3))*exp(-x(5))*x_s^(S_t-M_t) +
x(4)*x(3)*exp(-x(5))*x_b^(B_t-M_t)*x_s^(S_t-M_t)*x_b^(B_t-M_t)));
%x(1) = epsilon_b
%x(2) = epsilon_s
%x(3) = delta
%x(4) = alpha
%x(5) = mu_
__________________________________________
I call this function from matlabs command window:
[x,fval] = fminsearch(@nyfil,[1,1,1,1,1])
I get the following error messages:
??? Error: File: Nyfil.m Line: 12 Column: 115
Incomplete or misformed expression or statement.
Error in ==> fminsearch at 175
fv
,1) = funfcn(x,varargin{:});
_____________________________________
I dont understand why this expression is misformed or incomplete?
I try to solve the problem by starting with a small equation and then expanding it. Works with 2 variables in x but when I expand the equation f I get this error message. I would really appreciate if anyone could help me
Function:
function [f] = nyfil(x)
v=ones(50,1);
v=v*10;
B_t=v;
S_t=v;
M_t = min(B_t,S_t)+max(B_t,S_t)/2;
x_s = x(2)/(x(5)+x(2));
x_b = x(1)/(x(5)+x(1));
f= sum(x(1)-x(2)+M_t*(log(x_b)+log(x_s))) + S_t*log(x(5)+x(2)) + sum(log(x(4)*(1-x(3))*exp(-x(5))*x_s^(S_t-M_t) +
x(4)*x(3)*exp(-x(5))*x_b^(B_t-M_t)*x_s^(S_t-M_t)*x_b^(B_t-M_t)));
%x(1) = epsilon_b
%x(2) = epsilon_s
%x(3) = delta
%x(4) = alpha
%x(5) = mu_
__________________________________________
I call this function from matlabs command window:
[x,fval] = fminsearch(@nyfil,[1,1,1,1,1])
I get the following error messages:
??? Error: File: Nyfil.m Line: 12 Column: 115
Incomplete or misformed expression or statement.
Error in ==> fminsearch at 175
fv
_____________________________________
I dont understand why this expression is misformed or incomplete?
I try to solve the problem by starting with a small equation and then expanding it. Works with 2 variables in x but when I expand the equation f I get this error message. I would really appreciate if anyone could help me