Show cell elements in an Item in app designer

조회 수: 2 (최근 30일)
Celia Sanchez-Giron
Celia Sanchez-Giron 2022년 6월 8일
댓글: Celia Sanchez-Giron 2022년 6월 9일
Hi,
I am working with an object rob1 which is an humanoid robot.
rob1= Hum(Estacion1, eje, baseRobot_, q0_);
% The name of the joint (neck, arm, leg...) is stored in the cell "eje" this way.
%1: Cadera d gira
eje.CadDG=1;
%2: Cadera lateral d
eje.CadDL= 2;
% 3: Cadera frontal d (q pie se queda en suelo)
eje.CadDF= 3;
% 4: Rodilla d
eje.RodD= 4;
% 5: Tobillo frontal i
eje.TobD= 5;
% 6: Tobillo lateral i
eje.TobDL= 6;
% 7: Cadera i gira
eje.CadIG=7;
% 8: Cadera lateral i
eje.CadIL= 8;
% 9: Cadera frontal i (q pie se queda en suelo)
eje.CadIF= -9;
% 10: Rodilla i
eje.RodI= 10;
% 11: Tobillo frontal i
eje.TobI= 11;
% 12: Tobillo lateral i
eje.TobIL= 12;
% 13: Tronco lateral
eje.TronL=13;
% 14: Hombro d frontal
eje.HomDF= 14;
so if I write "fields(rob1.eje)" in the command window I will receive a cell with these elements.
I want to show this cell elements in appdesigner ItemBox, so instead pasing each name I want to pass the whole cell so it appears at the list box.
To call my "rob1" I use an general object "H" in appdesigner because I have different robots (rob1, rob2, rob3...).
properties (Access = private)
H;
end
My problem is that I would like to show the cell elements (eje) in the Itembox. How can I do that? if I write app.H.eje on the ItemBox I have no answer.
Thank you in advance!!!
  댓글 수: 2
Monica Roberts
Monica Roberts 2022년 6월 8일
Do you mean a list box? If you use a list box you can do:
mycell = fields(rob1.eje);
app.ListBox.Items = mycell;
Celia Sanchez-Giron
Celia Sanchez-Giron 2022년 6월 9일
Thank you! I think I found the answer. I have to write the code you just wrote and then call the app file from the command window. For example
appfile(H)
Thank you again for your help :)

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by