How to fix 'Undefined function or variable 'temp' in ode45'.
Mostrar comentarios más antiguos
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.

Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 23 de Feb. de 2017
0 votos
You have not stored the code in temp.m or temp.m is not on your path.
Note: global variables are the slowest kind of variables. You should avoid them. See https://www.mathworks.com/help/matlab/math/parameterizing-functions.html
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!