Live script, convert to local function
31 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Gerard Nagle
am 17 Mai 2022
Bearbeitet: Gerard Nagle
am 18 Mai 2022
Rather simple question, but I can't seem to find any example of it.
When in live script, a local function can be created, which I have no issue doing manually.
However, there is the option on right click, to "Convert to Local Function".
When I try to do so, I get "to make the section be analyzable, specify variable to clear explicity. (line 1)"
Does anyone have an example or link to when a section of script can be change from code to a local function. I cant find an example online.
1 Kommentar
Deepak Gupta
am 17 Mai 2022
Can you share the code you selected to produce above message? I am unable to produce this message and generating local function from script is working fine.
Akzeptierte Antwort
Cris LaPierre
am 17 Mai 2022
It is bad practice - and completely unnecessary - to create a function where the first command is clear. Remove this line of code from your script before trying to convert it to a function.
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!