Tags: action, application, callbacks, dynamic, flash, inpython, matlab, parses, programming, scripts, similar, variables, write

dynamic variables, callbacks

On Programmer » Matlab

1,765 words with 0 Comments; publish: Tue, 06 May 2008 16:25:00 GMT; (20070.31, « »)

Hi all,

I need to write a simple application (I used to write similar things in

Python and Flash action scripts).

The application parses comma-delimitered files and populates variables

with vectors. Ea file would like like this:

x,y,z,r

12,23,34,45

...

The vectors then get plotted in a figure as individual lines. I

designed a simple GUI using which the user can select a specific line,

and modify it (e.g. filter). The user should be able to delete existing

data, move data between figures obtained from diff files, etc. So far I

use the variable's names as they are, since I know what's in my file -

x,y,z, but I want them to be dynamic.

I am about two things.

(1) Where to store the (dynamic) variables corresponding to x,y,z,r?

Should they be included into the current figure's object, like this?

figure1.variable1.name = 'x';

figure1.variable1.value = [12 ...];

Or can I access the data from the figure's properties directly using

get()?

(2) I am about using dynamic arguments with callbacks.

Suppose, I have a button for "Filter" with a callback defined like this

(syntax might be messed up):

uimenu(all. data,'Label','Filter','Callback',['globa

l

data;','filter_data(data)']);

the variable "data" changes during runtime. Is the callback going to

see "data" as it existed when the callback was defined? Or does it only

get a handle to the data?

Sorry for the long post and thanks a lot in advance for help.

All Comments

Leave a comment...

  • 0 Comments