matlab解微分方程为什么老提示未定义的 t>> dydt = odefun(t,y)function dydt = vdp1000(t,y)dydt = [y(2); 1000*(1-y(1)^2)*y(2)-y(1)];[t,y] = ode15s(@vdp1000,[0 3000],[2; 0]);plot(t,y(:,1),'-');title('Solution of van der Pol Equation,\mu = 1
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 06:57:53
matlab解微分方程为什么老提示未定义的 t>> dydt = odefun(t,y)function dydt = vdp1000(t,y)dydt = [y(2); 1000*(1-y(1)^2)*y(2)-y(1)];[t,y] = ode15s(@vdp1000,[0 3000],[2; 0]);plot(t,y(:,1),'-');title('Solution of van der Pol Equation,\mu = 1
matlab解微分方程为什么老提示未定义的 t
>> dydt = odefun(t,y)
function dydt = vdp1000(t,y)
dydt = [y(2); 1000*(1-y(1)^2)*y(2)-y(1)];
[t,y] = ode15s(@vdp1000,[0 3000],[2; 0]);
plot(t,y(:,1),'-');
title('Solution of van der Pol Equation,\mu = 1000');
xlabel('time t');
ylabel('solution y_1');
Undefined function or variable 't'.
matlab解微分方程为什么老提示未定义的 t>> dydt = odefun(t,y)function dydt = vdp1000(t,y)dydt = [y(2); 1000*(1-y(1)^2)*y(2)-y(1)];[t,y] = ode15s(@vdp1000,[0 3000],[2; 0]);plot(t,y(:,1),'-');title('Solution of van der Pol Equation,\mu = 1
作为等号右边的变量,必须是前边已经定义过的或者出现过的.你可以在最前边声明t和y,并对它适当赋值.如果不需要赋值,直接给个声明也可.syms t y;