Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I need to call the system function to open up several other matlab terminals and call a function I wrote that will have variable input. I have tried a lot of different methods but to no avail. This is basically what I'm trying to do.

for i = 1:numberOfTerminals

system('C:\MATLAB\R2009b\bin\matlab -r myFunction(var1*i,var2)')

end

I get errors saying the variables are undefined.

I have tried

...

system(['C:\MATLAB\R2009b\bin\matlab -r myFunction(', var1*i, var2, ')' ]);

and

system(['C:\MATLAB\R2009b\bin\matlab -r myFunction(%var1*i%,%var2%)' ]);

etc...

Thanks for the help!

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: MATLAB 'system' function help

**Physics Forums | Science Articles, Homework Help, Discussion**