Azzera filtri
Azzera filtri

Is there a way to have LiveScript buttons call arbitrary functions?

3 visualizzazioni (ultimi 30 giorni)
Currently, it appears the LiveScript Button control only has options to run the script or run a section or do nothing.
I have LiveScripts with functions included at the bottom that appear to run whenever a LS control changes values.
Is there a way to have a LS button run a user-defined function?
I have sorta found a way, include a check box assigned to a variable. In the section, send the variable to a function and the function executes if the check box is checked. However, the function will execute every time the script re-runs unless the user unchecks the box. (is there a way to script changes to UI values or reset default values by script? Currently you have to click each control to reset it AFAIK).

Risposte (1)

Matt J
Matt J il 14 Feb 2023
  1 Commento
Edward Gatzke
Edward Gatzke il 16 Feb 2023
WRT to custom editor tasks, it looks like a non-simple path for basic users. If I give students a file, I want them to just run it in MATLAB and not have to install tasks, etc. They will already have enough trouble because Windows will name any second copy they download with a ' (1)' extension and break MATLAB file naming conventions.
I think I found a better way using dialog boxes like the one linked below. All the code can be included in the LiveScript file and once a student has completed the exercise the dialog box can pop up and they can submit their answers or try again.
Thanks for your help.

Accedi per commentare.

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by