I am developing a MATLAB GUI using app designer. I want to create a button which deletes specific variables. The variables are initially set using the setappdata function.

4 件のコメント

Adam
Adam 2017 年 7 月 7 日
If you are using appdesigner why use setappdata? An appdesigner GUI is based on a class which is a natural place to store all the data you need and is accessible in every function of the GUI class.
Tara Prasad Mishra
Tara Prasad Mishra 2017 年 7 月 8 日
Hi Adam, In the MATLAB app designer, I used a push button to load an image and now another push button to perform some operations on the image. If I do not use setappdata and getappdata, there is an error in the operation push button indicating undefined function image. (I do not want to define the image as a global variable due to further complications associated with it). Thank you.
Image Analyst
Image Analyst 2017 年 7 月 8 日
Hard, or impossible, to say without seeing your code.
Adam
Adam 2017 年 7 月 10 日
I've only really used appdesigner once, but apart from its annoying way of not allowing you to edit parts of the code it creates it is just based on a class whose entire purpose is to share data between its functions.
Show the code that you have, as Image Analyst says, to enable people to be more help.

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2017 年 7 月 8 日

0 投票

It depends on what "delete" means.
You do not create variables by the setappdata command, but this function stores the contents of the variables in the ApplicationData of a GUI element. Afterwards you can remove the entry by rmappdata, as mentioned in the documentation of setappdata.

カテゴリ

ヘルプ センター および File Exchange で Develop Apps Using App Designer についてさらに検索

タグ

質問済み:

2017 年 7 月 7 日

コメント済み:

2017 年 7 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by