Reputation: 25
From my TCL script I like to open Matlab command window and display if its Matlab win32 or win64.
Therefore I use the following command:
exec {*}matlab -nodisplay -nosplash -nodesktop -r "arch = computer; fprintf('%s \n', arch')";
However I keep getting error:
arch = computer; fprintf('%s
|
Error: String is not terminated properly.
If I run the same in Matlab no issues.
Could some kindly advice.
Thanks
Anj.
Upvotes: 0
Views: 661
Reputation: 246764
Tcl is substituting the \n
before handing the command to matlab. Escape it:
exec matlab ... -r "arch = computer; fprintf('%s \\n', arch')"
Or use braces
exec matlab ... -r {arch = computer; fprintf('%s \n', arch')}
Upvotes: 1