Not enough input arguments.
Ältere Kommentare anzeigen
Dear everyone,
I hope you are having a great day.
I found a code attached to a research whom his developer advices that is working regarding modelling biochemical process. However. when trying running it, I found some problems.
One is when I run the following function
function y1 = ADDE(t,y)
y1 = zeros(size(y));
and so on giving equations for y1(elements)
comes an error of "Not enough input arguments".
So should I define y first? because it is not performed in the orginial code.
Thanks
14 Kommentare
Star Strider
am 7 Sep. 2021
That function appears to be designed to use the MATLAB numeric differential equation integrators (such as ode45, or with a biochemical model, more likely ode15s).
If you use it in that context, it should work correctly, without any changes being made to it.
Check the paper to be certain that is how it is intended to be used.
.
Mohamed Eisa
am 7 Sep. 2021
Mohamed Eisa
am 7 Sep. 2021
Star Strider
am 7 Sep. 2021
My pleasure.
It would be helpful if you could post / attach a .pdf version of the complete paper (including any necessary supplements, since they usually contain the appendices with data and code).
Mohamed Eisa
am 8 Sep. 2021
Bearbeitet: Mohamed Eisa
am 8 Sep. 2021
Walter Roberson
am 8 Sep. 2021
To use that code you first have to run globalvariables in order to read data files and set up the global variables.
But after that, you need code that runs the ode15s function, and you have not posted that code.
Do not run ADDE by itself. You would need a call that looked more like
ode15s(@ADDE, tspan,initial_conditions)
and notice the @ there -- it is important! If you were to run
ode15s(ADDE, tspan,initial_conditions)
without the @ then you would get the error message you show.
Mohamed Eisa
am 8 Sep. 2021
Walter Roberson
am 8 Sep. 2021
Please post the code you use to make the ode15s call.
Mohamed Eisa
am 8 Sep. 2021
Bearbeitet: Mohamed Eisa
am 8 Sep. 2021
Walter Roberson
am 8 Sep. 2021
First you need to go to
function ad(tspan,u)
format long
[t,y] = ode15s(ADDE,tspan,u);
and change that to
function ad(tspan,u)
format long
[t,y] = ode15s(@ADDE,tspan,u);
after that, run the function that sets the global variables.
Once the global variables have been set, at the command line invoke
global tspan u
ad(tspan,u)
Mohamed Eisa
am 8 Sep. 2021
Walter Roberson
am 8 Sep. 2021
There are two references to the undefined variable N_aaY_aa
(There are other problems that I spent some time cleaning up, but this one I cannot deduce the value of.)
Mohamed Eisa
am 8 Sep. 2021
Walter Roberson
am 8 Sep. 2021
I would prefer if you posted the definition of N_aaY_aa so I can do more clean up and testing.
Antworten (0)
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!