Hii.I am new to matlab environment. I am unable o find out why I am getting error as" not enough input arguments".

1 回表示 (過去 30 日間)
MY code is
xo=0.4;
A=[];
b=[];
Aeq=[];
beq=[];
Q=100;
R=1;
N = 50;
U0= zeros(100,1);
% Umin= -1*ones(100,1);
% Umax=1*ones(100,1);
% U = fmincon(@cost1,U0,A,b,Aeq,beq,Umin,Umax,[],[],N);
x=xo; h = 0.1;
xo=[-0.5,0.5];
options = optimoptions(@fmincon,'Algorithm','sqp');
U = fmincon(@cost1,U0,[],[],[],[],[],[],@confuneq,options);
for k =1:N
S1= F(x(k),U(k));
S2=F(x(k)+0.5*h*S1,U(k));
S3=F(x(k)+0.5*h*S2,U(k));
S4=F(x(k)+h*S3,U(k));
x(k+1) = x(k) + (1/6)* (S1+ 2*S2+ 2*S3 + S4)*h;
k = k + 1 ;
end
% plot(x);
plot(U);
grid on
figure(); plot(x)
grid on
  1 件のコメント
KSSV
KSSV 2016 年 12 月 28 日
YOu have not specified the line number of error..and also the function cost1 is missing.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeRefinement についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by