Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Variables contract each other for different M files?

Subject: Variables contract each other for different M files?

From: Mike

Date: 31 Jul, 2013 08:29:58

Message: 1 of 3

Hi

When I am currently running an A.m file in matlab and this file takes a lot of time, I'd like to edit another B.m file.
If I start another matlab (run from start in Win7) to edit B.m file, some of the variables in B.m are the same names as A.m. Then if I run B.m, will these variables replace those in A.m which is running?

Mike

Subject: Variables contract each other for different M files?

From: Steven_Lord

Date: 31 Jul, 2013 13:37:43

Message: 2 of 3



"Mike" <SulfateIon@gmail.com> wrote in message
news:612b5b69-b23a-43b7-89c9-9a95fa51d5c1@googlegroups.com...
> Hi
>
> When I am currently running an A.m file in matlab and this file takes a
> lot of time, I'd like to edit another B.m file.
> If I start another matlab (run from start in Win7) to edit B.m file, some
> of the variables in B.m are the same names as A.m. Then if I run B.m, will
> these variables replace those in A.m which is running?

As described no, they won't interact. If the MATLAB sessions running A and B
were started using Parallel Computing Toolbox and the variables in question
were of the classes provided by that product to allow two (or more) MATLAB
sessions running in parallel to interact, then yes but that's not the
situation you described. [You have to do some work to get two MATLAB
sessions to interact with one another, or be using a shared resource like
the sound card or the same file on disk.]

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Variables contract each other for different M files?

From: Mike

Date: 1 Aug, 2013 06:36:31

Message: 3 of 3

Thank you for your reply.

Mike

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us