Monday, February 20, 2012

GUI in MATLAB 1

I've been busy with my other stuff, so there's not much to talk about C or C++.

So, I'm writing a quick start guide for GUI (graphic user interface) in MATLAB.

I'm assuming you know some about MATALB already. I hope you already know how to generate random x and y and plot them.

Ok, so GUI. Good thing about GUI is that you don't have to teach or learn how to use a program. Sometimes you write a code and a few months later you forget how to use it. That happens to many people. GUI removes that problem from the scene a lot.

Let's start with figure and figure-handle.

If you type
A figure shows up

That was easy.
Now, if you type
Same thing happens
But now you have "F1=1".
This "F1" is called figure handle and it lets you a lot more than just opening a window.
Even if you open a new figure without assigning a figure handle it still generates that number, but since it's not stored in anything it gets disregarded (well, almost).

Now type get(F1)
A whole bunch of information show up.
These are the summary of the specifications describing the figure you just opened.
"get(figure handle)" show you all about that figure. If you want to change something, you can try "set(figure handle ...)"
I'll talk more about "get" and "set" in the upcoming posts.

Many other things can have a handle. If you type "P1=plot(x,y)" when you plot something, this will let you control and manipulate that specific plot separate from other plots.

I'll write what you can do with these handles next time.

No comments:

Post a Comment