how to call a function

1 visualización (últimos 30 días)
dav
dav el 31 de Oct. de 2013
Comentada: dav el 31 de Oct. de 2013
Hi,
I am running a simulation program. in each simulation i have to use a number which i have to generate in a separate function.
The issue for me is can I call a function with out an INPUT and get the output.
Any small example code is highly appreciated!
dav

Respuesta aceptada

Andy
Andy el 31 de Oct. de 2013
Write the function you need and save it in the active directory or on the path i.e.
function [newnumber] = examplefunction
newnumber = rand;
end
From command window or in other m-file call the function by simply writing: -
x = examplefunction;
  1 comentario
dav
dav el 31 de Oct. de 2013
thank you very much!!!!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by