App Designer - Acccess Data in Workspace?

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 ExchangeData Import and Analysis についてさらに検索

製品

リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by