Execution of script ode45 as a function is not supported ... Error in pop (line 12) [a,b] = ode45(@yprime,[0,tfin],pinit);
조회 수: 69 (최근 30일)
이전 댓글 표시
Hi how do I fix this error message? Here is the code below.Im trying to plot logistic population growth.
global a
a = 2;
global b
b = 1;
tfin = 100; %tfin is the the length of time with you are solving for (time final)
pinit = 2.4; %establishes the initial p value, p(0)
[a,b] = ode45(@yprime,[0,tfin],pinit);
figure(1);
plot(a,b);
xlabel('Time')
ylabel('Population')
title('Logistic Population Growth')
댓글 수: 1
답변 (1개)
Steven Lord
2021년 10월 5일
You've written a script file ode45.m that's taking precedence over the ode45 function included in MATLAB. Check where that script file is located and rename or remove it.
which -all ode45
If you see an ode45.m that's not in the toolbox/ directory that's likely the culprit. Leave the files in either of those two locations (you may or may not have the one in toolbox/nnet) alone.
If you don't have another ode45.m then it's possible the file has been corrupted.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!