how to call a function

1 回表示 (過去 30 日間)
dav
dav 2013 年 10 月 31 日
コメント済み: dav 2013 年 10 月 31 日
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

採用された回答

Andy
Andy 2013 年 10 月 31 日
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 件のコメント
dav
dav 2013 年 10 月 31 日
thank you very much!!!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by