linking m-files togeher
3 次查看(过去 30 天)
显示 更早的评论
Is it possible to link 2 seperate m-files where both m-files has their own function with different saved name?
回答(1 个)
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 个评论
Walter Roberson
2015-6-10
if value_to_test == 1
name_of_first_file;
else
name_of_second_file;
end
另请参阅
类别
在 Help Center 和 File 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!