Number of push button change
Show older comments
I have an audio that I've split into 2 segments. I'd like to plot the audio file and add 2 push buttons in the figure, in order to play each segment. This part is quite standard to do. What if I decide to split the signal in 3 or 4, or more? How can I do that without creating all the possible push button? Is there any cleaver way of do it? Using a for loop uicontrol() would be a solutions.
Accepted Answer
More Answers (1)
Kevin Phung
on 18 Jan 2019
1 vote
Instead of having a pushbutton per segment, perhaps you can create a listbox that will be populated with the number of segments in your audio file.
Pushing the pushbutton will then play the selected segment.
2 Comments
João
on 19 Jan 2019
Image Analyst
on 19 Jan 2019
Would have been no problem with GUIDE where every callback function has access to ALL the controls and their values. But since you've accepted this answer, I guess you want to keep attempting to do it this way. I'm sure Kevin will answer shortly.
Categories
Find more on Audio and Video Data 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!