Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
ode45 error

Subject: ode45 error

From: Helmut

Date: 3 Jun, 2013 08:37:09

Message: 1 of 3

Running the example 1 i),n http://mathworks.de/de/help/matlab/ref/ode45.html

options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
[T,Y]=ode45(@rigid,[0 12],[0 1 1],options);
plot(T,Y(:,1),'-',T,Y(:,2),'-.',T,Y(:,3),'.');

with

function dy = rigid(t,y)
  dy = zeros(3,1); % a column vector
  dy(1) = y(2) * y(3);
  dy(2) = -y(1) * y(3);
  dy(3) = -0.51 * y(1) * y(2);

I get the error message

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

Error in ode45 (line 86)
      vodeoptions = odepkg_structure_check (varargin{1}, 'ode45');

Error in Example_1 (line 2)
[T,Y]=ode45(@rigid,[0 12],[0 1 1],options);:

I use R2012A student on Win7 64bit.
The same error occurs on both computers: desktop and laptop.
Does anyone know the cause or a solution?
Helmut

 

Subject: ode45 error

From: Steven_Lord

Date: 3 Jun, 2013 14:38:21

Message: 2 of 3



"Helmut " <Helmut.Buech@t-online.de> wrote in message
news:kohkjl$ltk$1@newscl01ah.mathworks.com...
> Running the example 1 i),n
> http://mathworks.de/de/help/matlab/ref/ode45.html
> options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
> [T,Y]=ode45(@rigid,[0 12],[0 1 1],options);
> plot(T,Y(:,1),'-',T,Y(:,2),'-.',T,Y(:,3),'.');
>
> with
> function dy = rigid(t,y)
> dy = zeros(3,1); % a column vector
> dy(1) = y(2) * y(3);
> dy(2) = -y(1) * y(3);
> dy(3) = -0.51 * y(1) * y(2);
>
> I get the error message
>
> Undefined function 'odepkg_structure_check' for input arguments of type
> 'struct'.
>
> Error in ode45 (line 86)
> vodeoptions = odepkg_structure_check (varargin{1}, 'ode45');

That is not line 86 in the ODE45 function included with MATLAB release
R2012a. Line 86 in the ODE45 file included with MATLAB is part of the input
argument validation and reads:

      tspan = [];

You probably have a different file named ode45.m on your path that is being
called instead of the file included with MATLAB, and that file probably has
a different signature than the one included with MATLAB. To check this,
type:

which -all ode45

The only file listed should be the one in the
MATLABROOT\toolbox\matlab\funfun directory.

> Error in Example_1 (line 2)
> [T,Y]=ode45(@rigid,[0 12],[0 1 1],options);:
>
> I use R2012A student on Win7 64bit.
> The same error occurs on both computers: desktop and laptop.
> Does anyone know the cause or a solution?

Remove the directory containing the other version of the file from your
MATLAB path (you can use PATHTOOL to do this) or rename it to avoid a
conflict with the ODE solver included in MATLAB.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: ode45 error

From: Helmut

Date: 4 Jun, 2013 08:52:11

Message: 3 of 3

"Steven_Lord" <slord@mathworks.com> wrote in message <koi9ot$lvp$1@newscl01ah.mathworks.com>...
>
>
> "Helmut " <Helmut.Buech@t-online.de> wrote in message
> news:kohkjl$ltk$1@newscl01ah.mathworks.com...
> > Running the example 1 i),n
> > http://mathworks.de/de/help/matlab/ref/ode45.html
> > options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
> > [T,Y]=ode45(@rigid,[0 12],[0 1 1],options);
> > plot(T,Y(:,1),'-',T,Y(:,2),'-.',T,Y(:,3),'.');
> >
> > with
> > function dy = rigid(t,y)
> > dy = zeros(3,1); % a column vector
> > dy(1) = y(2) * y(3);
> > dy(2) = -y(1) * y(3);
> > dy(3) = -0.51 * y(1) * y(2);
> >
> > I get the error message
> >
> > Undefined function 'odepkg_structure_check' for input arguments of type
> > 'struct'.
> >
> > Error in ode45 (line 86)
> > vodeoptions = odepkg_structure_check (varargin{1}, 'ode45');
>
> That is not line 86 in the ODE45 function included with MATLAB release
> R2012a. Line 86 in the ODE45 file included with MATLAB is part of the input
> argument validation and reads:
>
> tspan = [];
>
> You probably have a different file named ode45.m on your path that is being
> called instead of the file included with MATLAB, and that file probably has
> a different signature than the one included with MATLAB. To check this,
> type:
>
> which -all ode45
>
> The only file listed should be the one in the
> MATLABROOT\toolbox\matlab\funfun directory.
>
> > Error in Example_1 (line 2)
> > [T,Y]=ode45(@rigid,[0 12],[0 1 1],options);:
> >
> > I use R2012A student on Win7 64bit.
> > The same error occurs on both computers: desktop and laptop.
> > Does anyone know the cause or a solution?
>
> Remove the directory containing the other version of the file from your
> MATLAB path (you can use PATHTOOL to do this) or rename it to avoid a
> conflict with the ODE solver included in MATLAB.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

That helped. Thank you very much!
Helmut

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us