フィルターのクリア

Handling data form a table in appDesigner

1 回表示 (過去 30 日間)
Marco Picillo
Marco Picillo 2021 年 3 月 14 日
コメント済み: Marco Picillo 2021 年 3 月 17 日
Hi, I created a table in app designer, this table contains 5 columns (description,mass, x, y, z), i want to display a result (position center of gravity) in a numeric edit field, but i don't know how to manipulate the data from the table to do my calculations. I want to use the second, third, fourth e fifth columns and each row to do my calculus, but i dont't know how to do that in appDesigner.
Thank you!
Marco
  4 件のコメント
Cameron B
Cameron B 2021 年 3 月 16 日
Your callback doesn't like your brackets.
%%%% I'm mimicking your table
fig = uifigure;
t = uitable(fig,'ColumnEditable',true,...
'ColumnName',{'description','mass','x','y','z'},...
'Data',rand(5,5));
%%%% The only thing different is that you need to change the brackets, name
%%%% of your table (mine is t, yours is obviously app.UITable), and add
%%%% another . in your x_cog calculation.
mass_vector = t.Data(:,2);
x_vector = t.Data(:,3);
x_cog = sum(mass_vector.*x_vector)./sum(mass_vector);
app.NumericEditField.Value = x_cog;
Marco Picillo
Marco Picillo 2021 年 3 月 17 日
thank you very much!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop 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