Weird error when calling a function with parameters

Getting a strange error after calling this function that has a parameter, which I am providing. Attached file is the function.
z0=zeros(4,1);
z0(:,1)=5
one=1;
[w,fval]=fsolve(@test,one,z0);

2 件のコメント

Jan
Jan 2017 年 11 月 11 日
If you mention an error message, it would be a good idea to post a complete copy of the message. Do you want to let us guess, what you can see on your screen?
Star Strider
Star Strider 2017 年 11 月 11 日
Joaquin Saldain’s “Answer” moved here:
You're right, sorry. Here it is:
Field assignment to a non-structure array object.
Error in createOptionFeedback (line 33) options.(stopTestOptions{k}) = [];
Error in prepareOptionsForSolver (line 57) optionFeedback = createOptionFeedback(options);
Error in fsolve (line 152) [options, optionFeedback] = prepareOptionsForSolver(options, 'fsolve');

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

回答 (2 件)

Star Strider
Star Strider 2017 年 11 月 11 日

0 投票

The third argument to fsolve has to be an options structure.
I have no idea what you are doing with ‘one’ and ‘z0’. It is obvious that ‘z0’ is not an options structure.

カテゴリ

ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索

質問済み:

2017 年 11 月 10 日

回答済み:

2017 年 11 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by