Help me edit my matrices sizes

I am trying to find the RMSE from two sets of data, but I cant do so, because y is 20617x1 double, and y2 is 21093x1 double, can I please get some help?!
f=inline('-2/7*y^3 -2*y + 2*(2500 + 3000*cos(0.7*x))')
[x,y]=ode45(f,[0 30],26);
z=inline('-2*291*y + 2*(0 + 3000*cos(0.7*x))')
[x2,y2]=ode45(z,[0 30], 0);
xv=mean(abs((26+y2)-y));

답변 (1개)

Jan
Jan 2014년 1월 12일

0 개 추천

Avoid inline and use anonymous functions instead.
If you want the output of the integrator to specific time steps, request this explicitly as described in the help text of ODE45:
[x, y] = ode45(f, linspace(0, 30, 20000), 26);
[x2, y2] = ode45(z, linspace(0, 30, 20000), 0);

댓글 수: 1

Abdallah
Abdallah 2014년 1월 12일
Thanks a lot. It helped me :D

이 질문은 마감되었습니다.

질문:

2014년 1월 12일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by