How create .M file and function in that file with name same as file Name
Ältere Kommentare anzeigen
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 Kommentare
madhan ravi
am 21 Mär. 2019
Could you show an example?
Manohar Thunga
am 21 Mär. 2019
Adam
am 21 Mär. 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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!