You could put that code in an m-file then use COPYFILE to copy it to a new m-file, including the intended name.
Say your above template is saved as func_template.m and you want to make a new function named myfunc.m. Save this:
function [] = make_fun(V)
copyfile('func_template.m',V)
edit(V)
Then from the command line:
1 Comment
Sayyed Ahmad (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/56672-how-can-i-create-a-standard-matlab-template-for-new-programs#comment_579653
Sign in to comment.