How can I make a slider from App Designer change the background of a shape which is loaded from a text file, whilst moving it?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How can I make a slider from App Designer change the background of a shape which is loaded from a text file, whilst moving it?
6 Commenti
Voss
il 4 Dic 2021
I'm not sure what that for loop is supposed to do. It looks like the entire loop can be replaced with this line:
fill(app.Canvas, coordinates_x, coordinates_y, cName{1+changingValue});
and it'll do the same thing. (Note that the code inside the loop doesn't depend on the loop index ind or the variable color in any way, so it will just do the same thing over and over several times.)
Regardless, the fact that the fill is always yellow indicates that changingValue is always 0 (or at least it is never 1, 2, or 3). Perhaps print the value of changingValue to the command line from within the callback and make sure you get the values you expect when interacting with the slider.
Adam Danz
il 4 Dic 2021
I suggest using a discrete knob since you're referencing a discrete list of colors. Alternatively, see this answer to learn how to make a continuous slider behave as if it were discrete.
Risposte (1)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!