I am trying to execute a system command from within Matlab (there is no input or output from/to Matlab, I just need it to call the program and wait).
./forward < input
This works fine in a bash terminal (MACI64), but not from Matlab. I have tried,
!./forward < input
system('./forward < input')
and
unix('./forward < input')
Each time, the input file is ignored.
(I also tried making a shell script containing the full command, but the extra input was still ignored. Also, if I change the name of the input file to one that doesn't exist (e.g. input_null, I get the following error: "/bin/bash: input_null: No such file or directory")
Is there any way to make this work?
thanks.
PS, simpler commands like
!grep -i string < input
work fine from Matlab
Best Answer