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!

 Réponse acceptée

Taylor
Taylor le 4 Déc 2023
[rows, ~] = find(value == UITable.Data)
UITable.Data(r,:)

7 commentaires

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 le 4 Déc 2023
Modifié(e) : piston_pim_offset le 4 Déc 2023
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!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by