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:
How to make GUI take workspace value and run a parameter file?

Subject: How to make GUI take workspace value and run a parameter file?

From: Marco Wu

Date: 4 May, 2011 18:59:07

Message: 1 of 5

I want to send some parameters in a m file to workspace and use them in a GUI
Normally, I can run "parameters.m" in the command window, then the value will be workspace. However, I don't want to do it, because I need to pass this GUI to a friend who does not know much about Matlab.

My question are 1) how to run the parameter file automatically at the initnation of the GUI. 2) how to make all function in the GUI use and update those parameters? (Does global the only option??)

Subject: How to make GUI take workspace value and run a parameter file?

From: ImageAnalyst

Date: 4 May, 2011 19:39:43

Message: 2 of 5

Marco Wu:
See the FAQ:
http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.3F

I'm not exactly sure what "pass this GUI to a friend" means but I
guess he/she needs to run it on a different computer and read in the
parameters that you had set during the last run on your computer. If
so, I'd recommend saving them in a mat file that they can just read in
with the load command.

Subject: How to make GUI take workspace value and run a parameter file?

From: Marco Wu

Date: 4 May, 2011 20:43:21

Message: 3 of 5

Thanks. I just read the article. The information about 'handle' is very useful. However, I need to make a gui which would take and update initial parameters. How should I do that?






ImageAnalyst <imageanalyst@mailinator.com> wrote in message <eb76bd63-fdae-4975-a577-33a2b4950062@22g2000prx.googlegroups.com>...
> Marco Wu:
> See the FAQ:
> http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.3F
>
> I'm not exactly sure what "pass this GUI to a friend" means but I
> guess he/she needs to run it on a different computer and read in the
> parameters that you had set during the last run on your computer. If
> so, I'd recommend saving them in a mat file that they can just read in
> with the load command.

Subject: How to make GUI take workspace value and run a parameter file?

From: ImageAnalyst

Date: 4 May, 2011 23:32:57

Message: 4 of 5

A gui can take and return arguments just like any regular function.
Do it that way if you want. Or you can pass stuff back and forth via
a .mat file. Take your pick.

Subject: How to make GUI take workspace value and run a parameter file?

From: Josh

Date: 2 Aug, 2012 19:56:17

Message: 5 of 5

The question here might be if the GUI needs the Workspace as a medium to take/return arguments. I have the same question as well. I am making a GUI that I want to run without Matlab actually running in the background. The only way I know how to assign arguments is through the Workspace, but maybe I'm not doing this right.

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <0fb9be39-ab77-423a-aa3c-504098ca7edb@w24g2000yqb.googlegroups.com>...
> A gui can take and return arguments just like any regular function.
> Do it that way if you want. Or you can pass stuff back and forth via
> a .mat file. Take your pick.

Tags for 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