Monthly Archives: October 2012

[matlab] getting and setting value in other form/figure/gui

I often using need to do this in other visual programming (e.g. Visual Basic, Delphi), i.e. getting and setting value from other forms. LearningĀ  Matlab gui programming, I was a bit puzzled on how to do this because obviously we can’t do this: form2.edit1 in our Matlab’s m-script. After some searching, I finally got it, so, here I share what I found to Matlab’s newbie like me.
To follow, we will create two figures via GUIDE named form_1.fig and form_2.fig. Here’s the design for form_1
form_1 design
There are two edit-text named edtValForm2 and edtNewValue. Two pushbutton named pbGetVal and pbSetVal.
This is the design of form_2
form_2 design
There’s only one edit text here, named edit1 and set the ‘String‘ property value to “This is the default value in Form #2“. No coding needed in this form_2 because we will change the edit text via form_1

Getting value from other form

You should run form_2 first.
View pbGetVal callback on your m-script editor and enter the code below:

The comments on the code should enough to explain what happened in the code

Setting value into other form

View pbSetVal callback and enter the code below:

The codes also had comments to explain what happened.
Now run form_1, try clicking on pbGetVal and pbSetVal, you’ll see the effect.
form_1 and fomr_2 running together

Although I gave an example on edit text, this technique also work if you want to change other gui component value such as uitable ‘Data’ property or even plotting into axes in other form.


So, I’ve come to a place(=network) where you can’t access website. I download TV shows a lot, since a lot of TV shows download link is masked/hidden with service, I can’t access the real download page because it isn’t redirected properly. Finally I decided to create a PHP script that decode this URL into it’s real URL.
Here’s the final result (I know it’s ugly, but it works.. šŸ˜› ):
Although the site is created using PHP, I will not share the script. Why? Because a lot of webmasters (including me) gaining revenue from, I don’t want this kind of script kill those revenue source. It’s for personal use only.