Why does the second example fail?

4 vues (au cours des 30 derniers jours)
Derrick Salmon
Derrick Salmon le 13 Fév 2018
Commenté : Derrick Salmon le 14 Fév 2018
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 commentaires
Derrick Salmon
Derrick Salmon le 13 Fév 2018
Walter
Is there no way for the function so see the contents of testvec?
Walter Roberson
Walter Roberson le 13 Fév 2018
... Yes?
You are passing it in to the function, so the second argument can examine the contents of testvec.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 13 Fév 2018
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 commentaire
Derrick Salmon
Derrick Salmon le 14 Fév 2018
Worked perfectly - Thanks !!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by