You could try building the command string in a loop outside the dos() call and then make the calls.
A simple example is as follows:
A=[1 2 3 4 5];
Ai = num2str(A(i));
cmdstr = ['echome', ' ', Ai];
Output looks like the following, but the number passed as an argument changes from 1 to 5:
c:\temp>echo "my argument is " 1
"my argument is " 1
- You will likely want to do something with the result of the dos() command or check the return status, e.g. [status, result] = dos(command).
- "echome" is a batch file in the current working directory that contains "echo "my arg is" %1". If you wanted to expand out to four arguments, you would add %2 %3 %4 to it. You would call "xform", but might want to use a toy example like this to get the formatting figured out first if xform takes a while to run.