How to call a function m-file within another m-file

3 次查看(过去 30 天)
How can I call a separate function m-file within a for-loop of another m-file? Both are saved in the same path.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-9-30
Just call that function. If you have a function called myfun defined in myfun.m, you can call it anywhere in another m file.
a=1;
for k=1:3
myfun;
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by