Problems with run a m-file

*Dear Friends,
I have created a m file to solve an ODE with boundary conditions, but it do not run in my MATLAB version (R2008a), besides it run very well on MATLAB of my colleague (R2009a). The error that appears are:
*
??? Error using ==> times
Matrix dimensions must agree.
*Error in ==> odenumjac at 121 del = (s - (~s)) . abs(del); % keep del pointing into region
Error in ==> bvp4c>BCnumjac at 966 [dBCdya,ignored,ignored1,nbc] = odenumjac(@bcaux,bcArgs,bcVal,dBCoptions);
Error in ==> bvp4c>colloc_Jac at 671 [dGdya,dGdyb,nbc] = BCnumjac(bc,ya,yb,n,npar,nExtraArgs,ExtraArgs);
Error in ==> bvp4c at 187 [dPHIdy,NF,NBC] = colloc_Jac(n,x,Y,yp,Fmid,ode,bc,Fjac,BCjac,npar,...
Error in ==> nelsonreatorteste at 8 sol = bvp4c(@fun,@cc,solini);
The programmation of my m-file is:
function nelsonreatorteste
z = linspace (0,1,1000);
CTeo = 2.78e-06.*exp(9.4513.*z) + 0.904.*exp(-0.9043.*z);
solini = bvpinit(0:0.1:1,[0 1]); sol = bvp4c(@fun,@cc,solini);
x = linspace(0,1,1000) y = deval(sol,x);
plot(x,y(1,:),'o',z,CTeo,'-') xlabel('z') ylabel('C')
% Equação
% y(2) = dy(1);
function dydx = fun(x,y)
dydx = [y(2) (1/0.117)*(y(1) + y(2))];
% Condições de Contorno
function res = cc(ya,yb)
res = [ya(1)-0.117*ya(2)-1 yb(2)];
*Here, CTeo represents the analytical solution of ODE.
Why I can not run it in my MATLAB version?
Thank you for any informations,
Sincerely,
Isaías*

Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Tags

Asked:

on 2 Sep 2011

Community Treasure Hunt

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

Start Hunting!