Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Undefined function 'mtimes' for input arguments of type 'struct'.
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Jan
2016년 11월 17일
Please post the complete error message, such that we do not have to guess the line, which causes the error.
답변 (1개)
Alexandra Harkai
2016년 11월 17일
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
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!