Can someone explain where the values of the column vector z are coming from in this function?

조회 수: 1 (최근 30일)
This function is an ode45 solving a set of data from a separate script that calls up this function. However, I don't understand what the values z(1), z(2), etc. are and where they are coming from as they aren't part of the main script and only feature here. I tried calling up z in the command window but to no avail.
function zprime=vdpns_rhs(t,z)
global par
zprime=[z(2)
-par(1)*(z(1)^2-1)*z(2)-z(1)-par(1)*par(2)*(z(1)-z(3))
z(4)
(-par(4)*z(4)-par(6)/par(1)*z(3)-par(5)/par(1)*z(3)^3-par(2)*(z(3)-z(1)))/par(3) ] ;

채택된 답변

Star Strider
Star Strider 2014년 4월 16일
The variable z is an argument to vdpns_rhs and is local to it, so unless you display it from within vdpns_rhs, it’s not going to appear.
It is the dependent variable and function of t here. See the documentation on odefun in ode45 for details.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by