Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Undefined function 'mtimes' for input arguments of type 'struct'.

1 Ansicht (letzte 30 Tage)
zazar dalilo
zazar dalilo am 17 Nov. 2016
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
Jan
Jan am 17 Nov. 2016
Please post the complete error message, such that we do not have to guess the line, which causes the error.

Antworten (1)

Alexandra Harkai
Alexandra Harkai am 17 Nov. 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];

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by