All,
I am trying to set platform preferences dynamically based on User Input collected using a UI.
Essentially, the user specifies which Matlab version is installed on their machine and I am using that to construct a 32-bit and a 64-bit path to the root variable for Matlab on the users machine. However, this repeatedly results in an error:
Unexpected "\MATLAB\R2018a\". Perhaps there is a missing "," or ")".
Trying to parse arguments of function "MATLABROOT32".
Any help or advice is appreciated.
</CODE><CODE class=" language-jsl">user_matlab_ver = '2018a' ; // for example <BR />matlab_32bit_path = "C:\Program Files (x86)\MATLAB\R2018a\";
matlab_64bit_path = "C:\Program Files\MATLAB\R2018a\";
Eval( Parse( Eval Insert("\[ Platform Preferences( PathVar( MATLABROOT32( ^matlab_32bit_path^ ), MATLABROOT( ^matlab_64bit_path^ ) ) );]\" ) ) );
ConnectToMatlab = Expr(
matlab_conn = MATLAB Connect();
matlab_conn_flag = matlab_conn << Is Connected;
);
ConnectToMatlab;