In solving ode45 function, this error was appeared :
>> Error using odearguments (line 93)
>>THETA1 must return a column vector.
>>Error in ode45 (line 115)
>> odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
>>Error in Untitled2 (line 2)
>> [m, theta_int(0,:)]=ode45('theta1' ,0:.1:1,0);
as the function b=((w_theta./r).*((dr_m.*dz_s-dz_m.*dr_s)./(w_r.*dz_s-w_z.*dr_s))) is the equation demanded to solve with span 0:1

 채택된 답변

Jan
Jan 2018년 8월 19일
편집: Jan 2018년 8월 19일

0 개 추천

As the error message say clearly: Your function theta1 is expected to return a column vector. You did not post this function, but I guess, it returns a row vector.
Your code will fail due to
theta_int(0,:)
also: In Matlab indices must by greater than 0. Prefer to define the function to be integrated as function handle instead of using a char vector. The latter is outdated for 15 years now, but still supported for backward compatibility.
[m, theta_int]=ode45(@theta1, 0:.1:1, 0);
Are you sure that the initial value is the scalar 0? If you integrate a scalar, theta1 should reply a scalar also.

댓글 수: 1

muhamed badawi
muhamed badawi 2018년 8월 23일
thanks for your response, yes the initial value at m=0 is theta=0

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2018년 8월 19일

댓글:

2018년 8월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by