Too many input arguments.
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone, I have this fucntion and I get error during the running
function f = objCemaNeigesce(x,userdata)
Pt = userdata( :,1 ) ;
Tmoy = userdata( :,2 ) ;
Tmin = userdata( :,3 ) ;
Tmax = userdata( :,4 ) ;
lame_deau = userdata( :,5 ) ;
Zz = x.Zz ;
ZmedBV = x.ZmedBV ;
Beta = x.ZmedBV ;
gradT = x.gradT ;
Tf = x.Tf ;
Vmin = x.Vmin ;
QNBV = x.QNBV ;
[lame_deau,perf] = CemaNeige( Pt, lame_deau, Tmoy, Tmax, Tmin, Zz, ZmedBV, Beta, gradT, Tf, QNBV, Vmin);
f = perf(1) ;
Here is error I get :
>> objCemaNeigesce(x,userdata)
Error using CemaNeige
Too many input arguments.
Error in objCemaNeigesce (line 25)
[lame_deau,perf] = CemaNeige( Pt, lame_deau, x,
Tmoy, Tmax, Tmin, Zz, ZmedBV, Beta, gradT, Tf,
QNBV, Vmin);
Someone can help me?
Thank
2 件のコメント
Steven Lord
2022 年 6 月 28 日
You haven't showed us the definition of the CemaNeige function, but apparently from the error message it is not defined to accept 13 input arguments. It is defined to accept fewer than 13 inputs.
You're passing into CemaNeige the inputs you unpacked from the userdata input of objCemaNeigesce in a different order than they're arranged in userdata. To me that smells like it will cause a problem for users of objCemaNeigesce and/or CemaNeige at some point, where they'll pass the inputs into objCemaNeigesce in the order that CemaNeige expects or vice versa. At the very least one or both functions should have help text clearly indicating their calling signature.
採用された回答
dpb
2022 年 6 月 29 日
編集済み: dpb
2022 年 7 月 2 日
So much for help, Steven!!! :) Doncha just love folks who don't document a thing...not.
function [lame_eau, CemaParam] = CemaNeige( Pt, Tmoy, Tmax, Tmin, Date, CemaParam )
Shows the function expects and requires precisely six (6) input arguments. No more, no less.
So, fix the calling function to match --
[lame_deau,perf] = CemaNeige(Pt, lame_deau, Tmoy, Tmax, Tmin, Zz, ZmedBV, Beta, gradT, Tf, QNBV, Vmin);
was your calling statement; I count 12 instead of 13 inputs, but either is more than six.
Some of the variables you passed seem to match up; whether the fact the names are the same is good enough to be sure they're actually the right ones is another issue, but there are a number you've put in the list that don't match up at all...
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Dialog Boxes についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!