필터 지우기
필터 지우기

how to call a function

조회 수: 3 (최근 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 CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by