Reputation: 3153
I want to be able to pass in to a matlab script (or function) an argument which is a string. It works fine with integers but I cannot do it with Strings. Example: /usr/bin/matlab -nodisplay -r 'main('ana')'
I get: Undefined function or variable 'ana'.
I tried " as well and I get an error.
I have the same issue when main is a script and I write something like:
/usr/bin/matlab -nodisplay -r 'a='ana';main'.
Can you please tell me how to do this?
Thanks.
Upvotes: 1
Views: 1802
Reputation: 9157
Try using "
as delimiter for the command string:
/usr/bin/matlab -nodisplay -r "a='ana';main"
Upvotes: 4