Help in understanding ode45 options
Mostrar comentarios más antiguos
Hello everyone,
I have been looking at ode45 option examples and I can't get my head aroung this one, that seems to appear quite often.
Soory if it's a trivial question by the way; here is the code in question:
[sectioncon,Y]=ode45(@EOM,ppartie,param1,[],[6 5 4 3 2 1]);
What is the use of the empty parenthesis ? and the array of numbers after that ?
6 comentarios
Star Strider
el 29 de Abr. de 2020
I do not recognise that ode45 calling syntax. What MATLAB version/release are you using?
The empty square brackets [], denoting the empty array, tell the function (regardless of what the function is) to use the default value for that parameter. They are passed in place of the parameter in that position. (In MATLAB, the order of function arguments is important,)
Lucas Mangin
el 29 de Abr. de 2020
Star Strider
el 29 de Abr. de 2020
My pleasure.
Do you have any clue as to what MATLAB version was used for that ode45 call? Is tthere any indication in the code itself? As I mentioned, it does not look at all familiar to me.
Lucas Mangin
el 29 de Abr. de 2020
Star Strider
el 29 de Abr. de 2020
Editada: Star Strider
el 29 de Abr. de 2020
If that code still works, then it might be best just to leave it alone. If it has problems, it’s probably possible to rewrite it into more recent syntax so it will run correctly. For that, it’d be necessary to see some of the code preceeding it.
EDIT — If it runs as written, just leave it alone. It may not be worth the effort to make it compatible with the current syntax, unless it’s going to be used frequently in the future. In that situation, rewriting some of the rest of it for the same reason would also be appropriate.
Lucas Mangin
el 29 de Abr. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
