How to extract a app designer component from an array and change its properties
조회 수: 4 (최근 30일)
이전 댓글 표시
I currently have an issue where I have a 1x64 array of app designer components (lamps) and I want to be able to index the matrix then change the color of the lamp however Im unsure how to alter the lamp color after extracting it from the matrix.
example
D=[app.A1, app.B2, app.C3]
Desired_Lamp=D(1,Desired_Column)
댓글 수: 0
답변 (2개)
Harsha Priya Daggubati
2020년 3월 27일
Hi,
I guess you can use Property Inspector to know the properites of any variable present in the workspace. If it has any properties you can refer using '.' . I think it should go well. If not, can you share these variables so that I can investigate the issue with more clarity.
댓글 수: 2
Harsha Priya Daggubati
2020년 4월 7일
Hi,
I understood you want to change Color property of your Lamp component using Index.But, It is very difficult to guess to guess what Lamp component would be and its properties are. It would help if you can share your Lamp component.
Mehdi Ansarey
2025년 2월 17일
One strategy in these situations is indexing your components using Tag or Userdata.
e.g: you have some components i.e lamp and assign each a unique number in Tag.
then you can find desired lamp (that match your input guess) by its Tag
DesiredLamp= findall(app, Tag= ""+ i);
now process found Lamp
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!