Hi i want to save the Value from a variable number of Field in a variable number of cache. I know hot to get the Value from a variable number of field but i dont know how to safe them.
app.Mat_Cache(v) = get(app.MatField(v),'Value');

댓글 수: 1

TheDice
TheDice 2021년 4월 8일
Thank you so much. Sometimes it can be so easy but hard to find.

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

 채택된 답변

Cris LaPierre
Cris LaPierre 2021년 4월 6일

0 개 추천

Variables in an app are considered properties. See the Share Data Within App Designer Apps for how to create the property and then use it in your app. You'll also see that you do not need to use get or set anymore.

댓글 수: 4

TheDice
TheDice 2021년 4월 8일
Hi but i create this field via code with: app.Material_Field(v) = uieditfield(...
This ist not a Field created with the App Designer.
When i use: "get(app.Material_Field(v),'Value')" i can write the Value in a variable.
Cris LaPierre
Cris LaPierre 2021년 4월 8일
Mat_Cache and MatField should be properties of the app. It doesn't matter that assign them values in your code.
You can use app.Material_Field(v).Value to get the value property of a control.
TheDice
TheDice 2021년 4월 8일
When I write it like this: "app.Ausspg_Field(v).Value = 200;"
I get the following error: "Unable to perform assignment because dot indexing is not supported for variables of this type."
I stand corrected. When you capture multiple objects in a matrix, that variable is no longer a graphics object, and you cannot access the value that way. You'll have to use set and get. Sorry for the confusion.
app.Mat_Cache(v) = get(app.MatField(v),'Value');
% or
set(app.MatField(v),'Value',200+v);

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2021년 4월 6일

댓글:

2021년 4월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by