求助,如何在复制动态方程中加入变量。
    1 visualización (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    果博东方登录网址【微8785092】
 el 23 de Mayo de 2023
  
    
    
    
    
    Respondida: 果博东方开户网址【微8785092】
 el 23 de Mayo de 2023
            syms x
[t,x]=ode45(@odefun,[0 1],0.2);
plot(t,x)
xlabel('t')
ylabel('x')
function dxdt=odefun(t,x)
dxdt= x*(1-x)*(18.75*x-27.5);
end
如果想在dxdt= x*(1-x)*(18.75*x-27.5)中加入变量A,变成dxdt= x*(1-x)*(18.75*x+A-27.5),A=[40;50;60;70;80;90;],该如何操作呢
0 comentarios
Respuesta aceptada
  果博东方开户网址【微8785092】
 el 23 de Mayo de 2023
        syms x
A=[40;50;60;70;80;90;]
for ii = 1:length(A)
[t,x]=ode45(@odefun,[0 1],0.2,A(ii));
tr{ii} = t;
xr{ii} = x;
end
% 绘图的代码还需要自己修改
plot(t,x)
xlabel('t')
ylabel('x')
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Calculus en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
