Calling 2 functions into one .m file
1 次查看(过去 30 天)
显示 更早的评论
I have to call 2 functions, each with a different .m file, into a single .m file. How would I do this?
0 个评论
采纳的回答
KSSV
2018-3-1
Save the two m files as a funciton....and call them in a single m file.
function s = func1(a,b)
s = a+b ;
function d = func2(a,b)
d = a+b ;
Save the above two functions into m files. Call them in single m file:
a = rand ;
b = rand ;
s = func1(a,b) ;
d = func2(a,b) ;
a = s+d ;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!