필터 지우기
필터 지우기

Function failed to call the variable from workspace.

조회 수: 2 (최근 30일)
John Wray
John Wray 2016년 5월 24일
댓글: Stephen23 2016년 5월 24일
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?

채택된 답변

Walter Roberson
Walter Roberson 2016년 5월 24일
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
Stephen23
Stephen23 2016년 5월 24일
Indeed there are much better ways than using buggy evalin, and they are explained clearly in the documentation:

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by