why any function as m file, does not work on my pc?
Mostrar comentarios más antiguos
I have MATLAB2014a 32bit on my pc with windows8 64bit. I wrote an m file (function), but it didn't work and had error. after, I write a so easy m file, and has error!!!!! what should I do?
function y=new_state(x,v)
y=x+v
end
error is
Error using new_state (line 2)
Not enough input arguments.
Respuesta aceptada
Más respuestas (1)
Ilham Hardy
el 25 de Nov. de 2015
And did you call that with two arguments?
new_state(2,3)
2 comentarios
saeede soleymani
el 25 de Nov. de 2015
Ilham Hardy
el 25 de Nov. de 2015
Say you have variable a and b in the base workspace, then you can call
y = new_state(a,b);
If you want to call the new_state from within the function, you do not have direct access to the base workspace.
Perhaps it will best for you to open new question thread and better formulate your question (with more examples)?
Categorías
Más información sobre Simulink Functions 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!