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

New to MATLAB?

What is GUIDATA in graphical user interface ?

Asked by Jalaj Bidwai

Jalaj Bidwai (view profile)

on 27 Jul 2013

I am getting a hard time understanding guidata. I read many articles about it on mathworks site as well as other sites, but either none of them have explained it properly or I couldn't understand it:(. Can anybody please explain me in DETAIL about what guidata in simple words and is how it works and if possible please cite some EXAMPLE to explain it.

1 Comment

per isakson

per isakson (view profile)

on 27 Jul 2013

Did you try

    doc guidata

????

I cannot give an answer as good as the one you will find in the documentation

Jalaj Bidwai

Jalaj Bidwai (view profile)

Products

1 Answer

Answer by Jan Simon

Jan Simon (view profile)

on 28 Jul 2013
Edited by Jan Simon

Jan Simon (view profile)

on 28 Jul 2013

guidata stores a variable in the figure's ApplicationData and obtains it from there also. This is useful to store any data which belongs to a specific figure. guidata can be used to share variables between different callbacks.

Did you read doc guidata already?

2 Comments

Jalaj Bidwai

Jalaj Bidwai (view profile)

on 29 Jul 2013
 what is the difference between Application data and GUI data?
Jan Simon

Jan Simon (view profile)

on 29 Jul 2013

The figure has a property, which is called 'ApplicationData':

get(gcf, 'ApplicationData')

But guidata is a command, which writes are reads to and from this property field.

Notice, that there are neither "Application data" nor "GUI data", because the upper/lower case and the spaces matter.

Let me ask again, if you have read the corresponding documentation already. Matlab's help is very good (with some limitations for the 2013a release, how sad), so it is efficient, if you read it.

Jan Simon

Jan Simon (view profile)

Contact us