MATLAB: How to fix ‘Undefined function or variable ‘temp’ in ode45′.

functionode45undefinedvariable

My code below gives me the error
Undefined function or variable 'temp'.
when using the command
[t,u] = ode45(@temp,[0,20],[20]);
which I intent to create a graph with. As a note, I used 'global' to define and then set the values of my constants.
If necessary, the purpose of this code is to create a graph for a CPU temperature based on data from a lab.

Best Answer

Where is the file temp.m located? Is it in the current directory or on the MATLAB path? Is it a sub-function? The error indicates MATLAB does not see the file temp.m from where you call ode45.
Related Question