필터 지우기
필터 지우기

Function uses another function in a script

조회 수: 2 (최근 30일)
Meva
Meva 2014년 1월 15일
댓글: Meva 2014년 1월 15일
Hi guys,
Could someone highlight me? I am trying to write a script it uses more than one function. The second function uses the first one.
if c=c=dc
statement 1 %%this one I store as a function file in the same directory.
statement 2 %%this statement uses statement 1. Both statements are in for loop. If I use another function file for this, how can I unify them into this script?
if c=k
statement 1
statement 2
The question is how can I call and unify these two functions since the second function uses the first one..
Any help Appreciated
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 15일
This is not clear for me: function 2 calls function 1. What is the problem?
Meva
Meva 2014년 1월 15일
How can I express it? okay function2 calls function1 but I do not know what is the suitable code for this

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2014년 1월 15일
In file function1.m
...
...
whatever has to be done
In file function2.m
...
...
function1 %calls upon function1
...
...
Then just make sure both files are in directories on your MATLAB path.
  댓글 수: 1
Meva
Meva 2014년 1월 15일
Many thanks for the answer it seems basic but I am just at the beginning

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by