ode45 failing but other solvers work fine

2 visualizzazioni (ultimi 30 giorni)
Hi. One particular computer the script below is givng an error using ode45. On other computers ode45 works just fine. On the computer with the problem substituting ode23, ode133, ode152, etc. all work fine. No other changes are made (all have the same call syntex), ie, simply changing "45" to "23" gives the error shown below. This is completely bizarre to me. Any ideas?

Risposta accettata

Star Strider
Star Strider il 16 Ott 2020
Run this from your Command Window or a script:
which ode45 -all
You should only get:
C:\Program Files\MATLAB\R2020b\toolbox\matlab\funfun\ode45.mC:\Program Files\MATLAB\R2020b\toolbox\matlab\funfun\ode45.m
I suspect you will get more than that, pointing to the problem.

Più risposte (1)

Steven Lord
Steven Lord il 16 Ott 2020
Rename this file from ode45.m (which prevents you from calling the ode45 function included in MATLAB) to firstorderRK45.m. Don't just save it under the new name. You need to remove your ode45.m file entirely. [Leave the one in the toolbox\matlab\funfun directory under matlabroot alone.]
  1 Commento
Thomas Carr
Thomas Carr il 19 Ott 2020
Yea, this was it. Name conflict, which didn't occur to me but is pretty obvious in hindsight. Thanks.

Accedi per commentare.

Tag

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by