Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Matlab 32 and 64 bit on the same machine, how do you store settings in a different place?

For various reasons I need to do things in 64 bit and 32 bit Matlab.

Much to my chagrin... I found out recently that settings for both 32 and 64 bit Matlab are both stored in the same folder:

C:\Users\$USERNAME\AppData\Roaming\MathWorks\MATLAB\$MATLAB_VERSION

Here is a simple thing that I try to do... and it fails because they share the same settings folder!:

  • open Matlab 32 bit
  • choose a 32 bit C/C++ compiler
  • compile some code
  • close Matlab 32 bit
  • open Matlab 64 bit
  • compile the same code
  • ERROR... your compiler is not 64 bits...

I get an error in the 64 bit matlab... because !ARG! as soon as I change something in matlab 32 bit... it changes the same setting in Matlab 64 bit! In this case the setting is the C/C++ compiler.


Is there any way to have all your settings for Matlab 32 bit and 64 bit in separate folders?

  • If yes, how?
  • If no, using the same settings folder is there a workaround for this specific setting (compopts.bat stores the C/C++ compiler you choose)?

Here is an example of what I would like to have:

C:\Users\$USERNAME\AppData\Roaming\MathWorks\MATLAB\$MATLAB_VERSION\32bit
C:\Users\$USERNAME\AppData\Roaming\MathWorks\MATLAB\$MATLAB_VERSION\64bit
like image 988
Trevor Boyd Smith Avatar asked Sep 11 '11 16:09

Trevor Boyd Smith


People also ask

Can two versions of MATLAB on the same computer?

Accepted AnswerIt is possible to have multiple MATLAB installations on the same computer. Be sure to install each version in a different directory.

Can I run two MATLAB at the same time?

Direct link to this comment As long as you think of it as two functions, there is no way to run it simultaneously in MATLAB. You need either to create one function or offload one function to another process/thread.

Where are MATLAB preferences stored?

folder = prefdir returns the name of the preferences folder. The preferences folder contains preferences and settings for MATLAB® and related products, the command history file, MATLAB favorites files, and MATLAB desktop layout files.

How do I know if my MATLAB is 32 or 64 bit?

Direct link to this answer For MATLAB 7.8 (R2009a) and later versions, you can determine this information by selecting the "Help>About MATLAB" Menu from the desktop.


1 Answers

You can change the location of the preferences directory using the MATLAB_PREFDIR environment variables. Refer to this technical solution for a complete instructions.

like image 58
Amro Avatar answered Jan 13 '23 08:01

Amro