There's a function to create handles and to set their tag?
Show older comments
Hi everybody!
I'm implementing a program for a university exam. This program has to read a file and make statistics about some voices...
I'm trying to create a program that could be universal, with this type of file... So, starting by uniques of my vectors, I need a function that's able to create (for example) push buttons and to set their tag as "PB_A", "PB_B", using progressive letters or numbers...
After that I should point to the handles to calculate and show the statistics...
There's something for me??
Thanks to everyone!
Accepted Answer
More Answers (1)
Sean de Wolski
on 12 Dec 2011
0 votes
Instead of having pba pbb pbc, use a cell array or even a vector to store their handles. That way you can do things with them all at once and you don't run into the FAQ4.6 issues.
3 Comments
Jethro
on 12 Dec 2011
Sean de Wolski
on 12 Dec 2011
With pba, pbb, pbc, I'm trying to show your proposed labelling scheme for your pushbuttons and to recommend against it because of the issues in 4.6. Instead, build a vector of handles and reference it by index pb(1),pb(2) etc.
Walter Roberson
on 12 Dec 2011
Jethro only asked for the Tag to be set to those values, and the Tag of an object an arbitrary string with no inherent meaning to MATLAB itself.
Graphic object tags of static items are used by GUIDE in the creation of routine names such as callbacks, and in the structure field name in the handles structure. It is possible that Jethro is referring to Tag in that sense, expecting routines to be automatically generated, but Jethro did not quite ask for that.
Recall for this matter that using dynamic structure field names is one of the alternatives listed in the FAQ.
Categories
Find more on Code Execution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!