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
2016년 12월 28일
YOu have not specified the line number of error..and also the function cost1 is missing.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Refinement에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!