Function failed to call the variable from workspace.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
John Wray
am 24 Mai 2016
Kommentiert: Stephen23
am 24 Mai 2016
Hi,
I tried to call a variable of workspace in my function, but it failed with " Undefined function or variable 'kinect_image'."
Why can't I call the existed variable in workspace in my own function?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 24 Mai 2016
The variable might not be in the same workspace. If you defined it at the command prompt then it would be in the "base" workspace rather than in the function's workspace. You can retrieve variables from the base workspace:
evalin('base', 'kinect_image')
but almost always a better way is to pass the variable to the function.
1 Kommentar
Stephen23
am 24 Mai 2016
Indeed there are much better ways than using buggy evalin, and they are explained clearly in the documentation:
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Whos 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!