How do I automatically run an .m file?
2 次查看(过去 30 天)
显示 更早的评论
I have written an .m file that outputs two graphs. I need to run it numerous times to validate it. Is there a way to automate running it while checking for the success criterion?
0 个评论
回答(2 个)
YT
2018-10-23
Make a function out of it...
%%GraphFunction.m
[outputarguments] = function GraphFunction(inputarguments) %leave empty if no input/output arguments
%do some stuff
end
... create another file and call your graph function in a loop...
%%%Main.m
a = 100; %amount of times you want to run the GraphFunction
for i = 1:a
outp = GraphFunction();
%check if your output was ok
end
0 个评论
Image Analyst
2018-10-24
You can automatically run it when you launch MATLAB by calling the script or function from within your startup.m file.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!