Thread Subject: Sharing data between GUIs without using workspace

Subject: Sharing data between GUIs without using workspace

From: M.Mohsin Siraj

Date: 5 Sep, 2008 03:15:03

Message: 1 of 6

Guyz
i wanna know is there any method by which i can exchange my
variables from one GUI to other GUI?
If i use workspace in between, After making the .exe file
of my GUI, how will then it works??
SO any method knidly guide me. plz

Subject: Sharing data between GUIs without using workspace

From: M.Mohsin Siraj

Date: 5 Sep, 2008 03:22:02

Message: 2 of 6

"M.Mohsin Siraj" <stylismoh@mathworks.com> wrote in message
<g9q87n$kc8$1@fred.mathworks.com>...
> Guyz
> i wanna know is there any method by which i can exchange
my
> variables from one GUI to other GUI?
> If i use workspace in between, After making the .exe file
> of my GUI, how will then it works??
> SO any method knidly guide me. plz


I am using "Guide" to design the GUI...

thnx n Regards,

Subject: Sharing data between GUIs without using workspace

From: Walter Roberson

Date: 5 Sep, 2008 04:42:04

Message: 3 of 6

M.Mohsin Siraj wrote:

> i wanna know is there any method by which i can exchange my
> variables from one GUI to other GUI?
> If i use workspace in between, After making the .exe file
> of my GUI, how will then it works??

Do I understand correctly that you plan to be using two
independent .exe files and you want to communicate variables
between them?

If so then you will have to use I/O to write the values of
the variables out from one and read (a copy of) the values
in the other. You might be able to make the process more
efficient by using memory mapping, but that would be just an
optimization. I don't think you would be able to "share"
variables between the two in the sense that changing the
value of the variable in one of them would automatically
change the value of the variable in the other (though I would
not rule out that possibility -completely-.)


--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Subject: Sharing data between GUIs without using workspace

From: carlos lopez

Date: 5 Sep, 2008 12:10:17

Message: 4 of 6

Walter Roberson <roberson@hushmail.com> wrote in message <wM2wk.67483$hx.28408@pd7urf3no>...

> I don't think you would be able to "share"
> variables between the two in the sense that changing the
> value of the variable in one of them would automatically
> change the value of the variable in the other (though I would
> not rule out that possibility -completely-.)
It depends on the underlying OS. I am aware that such mechanism exist at least in LINUX, and one example is the one which allows changing the language environment and it might affect immediately all the (properly coded) applications.
BTW: I do not interpret the request from the user that he plans to connect two different exe applications. IMHO he plans to connect two windows opened by the same application. But I might be wrong..
Regards
Carlos

Subject: Sharing data between GUIs without using workspace

From: Jeremy Smith

Date: 5 Sep, 2008 15:17:02

Message: 5 of 6

If you're using one GUI which spawns other GUIs then yes, you can use the base workspace. When I created my GUI I was surprised to find that there is a base workspace but it worked just as if I were in Matlab. I designed my GUI programmatically so I'm not sure if GUIDE will have any other difficulties.

Subject: Sharing data between GUIs without using workspace

From: Walter Roberson

Date: 5 Sep, 2008 16:41:32

Message: 6 of 6

carlos lopez wrote:
> Walter Roberson <roberson@hushmail.com> wrote in message <wM2wk.67483$hx.28408@pd7urf3no>...

>> I don't think you would be able to "share"
>> variables between the two in the sense that changing the
>> value of the variable in one of them would automatically
>> change the value of the variable in the other (though I would
>> not rule out that possibility -completely-.)

> It depends on the underlying OS. I am aware that such mechanism exist at
> least in LINUX, and one example is the one which allows changing the language
> environment and it might affect immediately all the (properly coded) applications.

In computer languages such as C, you can have pointer variables that can point
into a shared memory (or memory mapped) block of memory; if multiple processes
share the block, then a change by one of the processes of the content of the
block will affect the other processes "automatically" (provided that in C
or C++ you declared the variables to be 'volatile' so that the compilers do
not rely on a copy of the value they have stuffed into a register and do
not make optimizations that depend upon the value of the variable being
a constant within a loop.)

But in Matlab, there are no user-level pointers and no commands that I know of
to place variables within shared areas (you would have to disable copy-on-write
for such variables, of course.) You might perhaps be able to do it at the
mex level by requesting an array header and setting its data pointer as
you wanted into the shared area, but that would have problems at least as great
as those that occur when you malloc() space for a variable in C. I believe that
I've read postings from people who say that you can do that if you are careful;
I have never looked at the details myself. I suspect the Matlab routines are not
designed with the expectation that they might be dealing with volatile memory.

--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Tags for this Thread

Everyone's Tags:

gui

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
gui M.Mohsin Siraj 4 Sep, 2008 23:20:17
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com