What is the command for making a brand new script, by an already existing script?
8 次查看(过去 30 天)
显示 更早的评论
The command mkdir('folder name') creates a folder at current location. I search for the command that creates a script instead. (I wonder too where to read about it)
0 个评论
采纳的回答
Image Analyst
2017-1-23
You need three commands, at least. First call fopen(), then frpintf() as many times as you need, then fclose():
fid = fopen('myScript.m', 'wt');
fprintf(fid, 'clc;\n');
fprintf(fid, 'workspace;\n');
fprintf(fid, 'close all;\n');
% etc. for however many commands you want to put into your m-file.
fclose(fid);
更多回答(1 个)
John D'Errico
2017-1-23
There is no special command.
Just save a simple file. Use .m as the extension, and it will be interpreted as a script.
1 个评论
Walter Roberson
2017-1-23
The matter does, though, get more complicated for Live Scripts ('.mlx') files.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!