let a script run in other script with variable parameters
3 views (last 30 days)
I want to let a script (ex: project.m) run in other script (ex: main.m) with changing parameters.
It means, the parameters is set in the main.m script and the project.m is loaded from the main.m and runs in a for-loop with the defined parameters.
Thank you so much for your answer!
Abderrahim. B on 4 Jul 2022
Hi Minyoung ,
You can run a matlab script inside another this way :
A good practice is to create a function from your script project.m and call it then in you main:
function [outArg1, outArg2,..,outArgN] = project(inArg1, inArg2, ..,inArgN )
% call your function
M = 10 ;
for ii = 1:M
[outArg1, outArg2,..,outArgN] = project(inArg1, inArg2, ..,inArgN ) ;