Why does data deleted from the workspace after execution the code ?
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
omar th
am 15 Aug. 2022
Kommentiert: omar th
am 15 Aug. 2022
If I have the below code, why the data are erased from the workspace after finishing the excution of the code ?
function something
while
for i
calculations
end
if condition
break
end
end
end
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 15 Aug. 2022
Because it's a function, not a script. Variables from a script wil remain in the base workspace after the script finishes. With functions, once the function finishes and returns, the variables internal to the function vanish.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Object Identification finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!