Show cell elements in an Item in app designer

1 次查看(过去 30 天)
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
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