×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

A Problem with Callback for uicontrol

A Problem with Callback for uicontrol

A Problem with Callback for uicontrol

(OP)
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

RE: A Problem with Callback for uicontrol

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

RE: A Problem with Callback for uicontrol

(OP)
Now you help, thanks so much!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources