MATLAB Answers

Global variables and multiple licenses of Matlab

7 views (last 30 days)
Wouter
Wouter on 28 Feb 2013
Hello everyone,
At the moment I'm running multiple Matlab licenses on the same computer. My analyses utilize the same function m-file which uses global variables.
Can anyone tell me if these different instances of Matlab are able to access and use the single function file, without interfering with one anothers calculations?
Thanks in advance!

  0 Comments

Sign in to comment.

Accepted Answer

Daniel Shub
Daniel Shub on 28 Feb 2013
Each instance of MATLAB is completely independent. Things like global variables are local to the instance of MATLAB that created the variables. If you are accessing hardware like a disk or serial port you can run into problems. Potentially doing things on a GPU could be problematic. In general you shouldn't have any problems.

  0 Comments

Sign in to comment.

More Answers (2)

Jan
Jan on 28 Feb 2013
Edited: Jan on 28 Feb 2013
In fact, the other way around is complicated: Sharing variables between Matlab sessions requires very smart strategies, see FEX: sharedMatrix.
But beside the warning, that global variables are a bad programming style, you can run into troubles, when you store them temporarily on the disk due to collisions.

  0 Comments

Sign in to comment.


Wouter
Wouter on 28 Feb 2013
Good to know, thank you both!

  0 Comments

Sign in to comment.

Sign in to answer this question.


Translated by