not enough input arguments

1 次查看(过去 30 天)
kiruba bagirathi
kiruba bagirathi 2014-12-2
评论: Jan 2014-12-2
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
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
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 个)

类别

Help CenterFile 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!

Translated by