Code Previously Worked, Now keep getting "Unexpected Matlab Expression"..
Mostrar comentarios más antiguos
function [t,x,u] = vehicleModel(0,10)
[t,u] = ode45(@vehicleAccel, [10], 0, options);
x = cumtrapz(t,u);
return
The Code above is a function file which links to two other functions, and all together are run off another script. Earlier in the day, the file worked, and I was able to plot a graph off it. Now, it doesnt work, and the only thing I changed, was a value assigned to a variable in a separate function. How can I resolve this? Matlab is saying the 0 in the first line is what is causing the problem.
Respuestas (2)
Sean de Wolski
el 25 de Feb. de 2015
function vehicleModel(0,10)
A variable name must start with a letter, and a function must take in variables.
function vehicleModel(q,k)
Will work since q and k are valid variable names.
The values of q and k could be anything
Categorías
Más información sobre MATLAB 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!