not enough input arguments
이전 댓글 표시
Hi, I am new to Matlab, When I try to run this in my main program it says not enough input arguments.
function [fun,grad]=myobjfun1_vers5(X,X1,JS_X1,l,k,I)
X=rand(34,3);
A1=norm(X*transpose(X)-X1*transpose(X1),'fro')^2;
A2=norm(X*transpose(X)-JS_X1*transpose(JS_X1),'fro')^2;
fun=(l-k)+1/2*(A1+A2);
if nargout>1
grad=(X*transpose(X)-X1*transpose(X1))+(X*transpose(X)-JS_X1*transpose(JS_X1));
end
Can you help to come out of this problem? The inputs are all matrices.
댓글 수: 2
Julia
2014년 12월 2일
How do you call your function in the main program? I guess you don't use enough input arguments doing it.
Why do you put X as input argument when your first action is to compute X as a random generated matrix?
Jan
2014년 12월 2일
Please format the code using the "{} Code" button in the future.
For an efficient help a copy of the complete error message is required. Most of all it contains the failing line. Currently we can only guess which line causes the error.
Please add the additional information by editing the question, not inside a comment. Thanks.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!