Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

A Problem with Callback for uicontrol 1

Status
Not open for further replies.

uchen

Computer
Feb 27, 2005
4
Hi there!
I define the string for callback uicontrol like this:
K=1;
callbackStr = ['struktur(' K ')'];

h = uicontrol(h_fig, ...
'style', 'pushbutton', ...
'Units', 'char', ...
'position', pos, ...
'string', char(187), ...
'FontName', 'Helvetica', ...
'FontSize', 9, ...
'Tag', n,...
'callback', callbackStr);

Then Matlab gives error messages :
Error: Missing variable or function.
Error while evaluating uicontrol Callback.

Does somebody here have an idea, what did I do wrong?

Does anyone also know how to describe callbackStr for more than one parameter? Say it: K, L, M.

Thanks before hand,
Dina
 
Replies continue below

Recommended for you

It seems to me that you want to be able to select different callback function names from a structure.

In that case this will fix at least part of your problem:

callbackStr = ['struktur(' num2str(K) ')']

Let me know how it works for you!
/Jacc
 
Now you help, thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor