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 Center および File ExchangeSolver 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