How create .M file and function in that file with name same as file Name
Show older comments
I want to create a .M file and function in that file which should accept input arguments.
example:
File with name as myFuntion and should contain following code in that file
function Myfunction(~,msg)
end
3 Comments
madhan ravi
on 21 Mar 2019
Could you show an example?
Manohar Thunga
on 21 Mar 2019
Adam
on 21 Mar 2019
I use a series of fprintf commands when I want to dynamically write a .m file (e.g. I have a function that creates a template for a unit test for a given function name). There's not much else to it though beyond getting all the formatting right ini those fprintf instructions.
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!