Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Undefined function 'mtimes' for input arguments of type 'struct'.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello! Please I need a help here? Here is my script
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% x=[1 1.2 1.3 1.4 1.5];
A=[-1.3 -0.6; -0.5 -0.6];
Ad=[0.1 0; 0.1 0.1];
s=[0;0]; alpha=0.5; t1=0.1; x_tau_d=[0.7;0.6];
for k=0:0.01:1000
fun1=@(tau,y) (t1-tau).^(k+1).*x_tau_d(1);
fun2=@(tau,y) (t1-tau).^(k+1).*x_tau_d(2);
s = s + [ode45(fun1,[0 t1],0);ode45(fun2,[0 t1],0)];
end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Thanks,
1 comentario
Jan
el 17 de Nov. de 2016
Please post the complete error message, such that we do not have to guess the line, which causes the error.
Respuestas (1)
Alexandra Harkai
el 17 de Nov. de 2016
This gave me a different error in the first loop:
Undefined operator '+' for input arguments of type 'struct'.
Which is coming from the fact that the result of ode45() is a struct array with a few fields. Then the arithmetics won't make sense on a struct. You can pick the solutions you need from there:
sol1 = ode45(fun1,[0 t1],0); sol2 = ode45(fun2,[0 t1],0);
s = s + [sol1.y; sol2.y];
0 comentarios
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!