- **Programming**
(*https://www.linuxquestions.org/questions/programming-9/*)

- - **(Something like...) passing an argument to a MATLAB script**
(*https://www.linuxquestions.org/questions/programming-9/something-like-passing-an-argument-to-a-matlab-script-777303/*)

(Something like...) passing an argument to a MATLAB scriptHi there, I have a MATLAB-LINUX question.
I have a MATLAB script (script.m) that looks something like this: Code:
`subject = '1234';` What I would like to have is a one line command that passes the subject number '1234' to the script and runs the MATLAB script. I've read another posting http://www.linuxquestions.org/questi...d.php?t=728099 that seems something like what I'm looking for but it's actually too complex for my purpose (and understanding). I'm looking for something like this: script.m will have the following first line: Code:
`subject = '$1';` Code:
`matlab -nodisplay "1234"='$1' script.m` Thanks for any suggestions, |

my own solutionmy solution:
matlab -nodisplay /r "x=1234;script.m" When script.m would start with Code:
`subject = 'x';` I found it here after I posted the message: http://www.mathworks.com/support/sol...lution=1-1BS5S I hope it is of use for others... |

All times are GMT -5. The time now is 12:17 AM. |