There is an input and I want to get the other values in the row where this input is equal to one of the values in the first column of the UITable.
I think l need something like:
idx = UITable.ColumnName.SerialNumber==3
Thanks for your help!

 채택된 답변

Taylor
Taylor 2023년 12월 4일

0 개 추천

[rows, ~] = find(value == UITable.Data)
UITable.Data(r,:)

댓글 수: 7

It says:
Undefined function 'eq' for input arguments of type 'table'
If UITable is a uitable, then UITable.Data would be a table() object, and you would do something like
uit = UITable.Data;
mask = value == uit.SerialNumber;
selected_rows = uit(mask,:);
piston_pim_offset
piston_pim_offset 2023년 12월 4일
편집: piston_pim_offset 2023년 12월 4일
Actually it is app.UITable, but l'll try this in a few minutes.
Got en error @Walter Roberson:
Unrecognized method property or field 'SerialNumber'
UITable.Data can return any of the following types: table array, numeric array, logical array, cell array, string array, or cell array of character vectors. If you run the following command you will be able to tell what type of data you are working with:
uit = app.UITable.Data;
class(uit)
"app.UITable" implies you are working within App Designer. Within App Designer, components/functions/properties specific to the app are called with the prefix "app.". It's just a syntax error, so if you add the prefix to you code that should allow you to interface with the UITable.
I have tried your correction but errors are the same.
Once you have done
uit = app.UITable.Data;
then what shows up for
uit.Properties.VariableNames
I finally made it work by combining your answers @Taylor and @Walter Roberson Thanks a lot for your help!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

질문:

2023년 12월 4일

댓글:

2023년 12월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by