linking m-files togeher

조회 수: 3 (최근 30일)
Steven Chong
Steven Chong 2015년 6월 10일
댓글: Walter Roberson 2015년 6월 10일
Is it possible to link 2 seperate m-files where both m-files has their own function with different saved name?
  댓글 수: 1
per isakson
per isakson 2015년 6월 10일
What exactly do you mean by "link 2 seperate m-files" ?

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

답변 (1개)

dpb
dpb 2015년 6월 10일
You don't actually "link" m-files together, you create a script (or another function) that calls the two successively. Or, if they're always used together but it's handy for factorization to have them as two functions, the one which is called by the other can become a subfunction within the same file. In this case that second function is not visible outside the file, however, only accessible to the primary function in the file. This may (or may not) be the behavior desired; all depends on your needs.
  댓글 수: 4
Steven Chong
Steven Chong 2015년 6월 10일
If I conditions were using 1 or 2 should be the same?
Walter Roberson
Walter Roberson 2015년 6월 10일
if value_to_test == 1
name_of_first_file;
else
name_of_second_file;
end

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

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by