Hallo,
I have some data in the Workspace which I can access without any problems from the command window. However, if I try to call the variable in a callback function it does not work. It says that it is not recognizing a variable with such a name though the data is in the Workspace already.
How can I access the data which is already in the workspace in the appdesigner callback?
thanks.
regards
Erkan

댓글 수: 1

Stephen23
Stephen23 2021년 8월 21일
The neatest, easiest, simplest, and by far the most efficient approach is to pass data as input/output arguments:
The MATLAB documentation clearly describes passing data as input/output arguments as "best practice".
Did you try passing the data as input/output arguments?

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

 채택된 답변

Image Analyst
Image Analyst 2021년 8월 20일

1 개 추천

From the help:
Evaluate Variable Name in Base Workspace
Use the evalin function to get the value of a variable in the MATLAB base workspace and store it in a new variable.
Define var as the 5-by-5 matrix returned by the magic function.
var = magic(5);
Get the value of the variable var in the MATLAB base workspace and store it in the variable v.
v = evalin('base','var')

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2021년 8월 20일

댓글:

2021년 8월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by