Why does the second example fail?

4 ビュー (過去 30 日間)
Derrick Salmon
Derrick Salmon 2018 年 2 月 13 日
コメント済み: Derrick Salmon 2018 年 2 月 14 日
here's my code and the response
testvec = [Xc,Yc,sig,A]
ErrTest1 = RMS_Err_func(Image,Xc,Yc,sig,A)
ErrTest2 = RMS_Err_func(Image,testvec)
gives:
ErrTest1 =
0.0942
Not enough input arguments.
Error in NM_2D_Gauss_fit>RMS_Err_func (line 60)
r(l,m) = sqrt((l-Xc).^2+(m-Yc).^2);
Error in NM_2D_Gauss_fit (line 46)
ErrTest2 = RMS_Err_func(Image,testvec)
  3 件のコメント
Derrick Salmon
Derrick Salmon 2018 年 2 月 13 日
Walter
Is there no way for the function so see the contents of testvec?
Walter Roberson
Walter Roberson 2018 年 2 月 13 日
... Yes?
You are passing it in to the function, so the second argument can examine the contents of testvec.

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

採用された回答

Walter Roberson
Walter Roberson 2018 年 2 月 13 日
I suspect that your testvec is a vector that has within it values for Xc, Yc, sig, A . If so then,
temp = num2cell(testvec);
ErrTest2 = RMS_Err_funct(Image, temp{:});
  1 件のコメント
Derrick Salmon
Derrick Salmon 2018 年 2 月 14 日
Worked perfectly - Thanks !!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by