Too many input arguments
65 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dursman Mchabe
am 9 Feb. 2019
Kommentiert: Dursman Mchabe
am 12 Feb. 2019
Hi everyone,
I know this is a self-explaining error. I know it is usually caused by:
1) Passing a function more input arguments than it expected to receive, perhaps by passing a list of inputs rather than a vector of inputs, or have tried to obtain two outputs from a function that only returns one.
2) You have multiple functions with the same name. etc.
But I think all my inputs the function in line 117 are requred, yet I still get an error message:
Error using fzero (line 306)
FZERO cannot continue because user-supplied function_handle ==> @(pH)HionpH(pH,b) failed with the error below.
Too many input arguments.
Error in SlurryCase10Feb2019>kinetics (line 117)
pH = fzero(@(pH)HionpH(pH,b),pH1);
Error in lsqcurvefit (line 213)
initVals.F = feval(funfcn_x_xdata{3},xCurrent,XDATA,varargin{:});
Error in SlurryCase10Feb2019 (line 73)
[b]=lsqcurvefit(@kinetics,b0,tdata,ydata);
Caused by:
Failure in initial objective function evaluation. LSQCURVEFIT cannot continue.
What can I change, on the attached code, to solve this problem?
2 Kommentare
BERGHOUT Tarek
am 10 Feb. 2019
send me the main program and subprogmes in rar file , and i will help you
Akzeptierte Antwort
Stephen23
am 10 Feb. 2019
Bearbeitet: Stephen23
am 10 Feb. 2019
Everywhere you call function HionpH you call it with two input arguments, but you defined the actual function with just one input argument (thus the error):
function ph = HionpH (pH)
"What can I change, on the attached code, to solve this problem?"
There are two possible solutions:
- only call HionpH with one input argument (matching how it is defined), or
- change the definition to accept two input arguments, e.g.:
function ph = HionpH(pH,b)
and then you will have to decide what you want to do with that input (if anything).
6 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!