Compare editfield.value to table values in app designer
古いコメントを表示
Hello.
I wanna make an app that is comparing a value(from editfield numeric) to a table imported from excel. The table has 3 columns (z , f , d). The value has to be found in the z column. If found, the f and d colums values coresponding to z has to be displayed. Can you help me? It's my first app made in app designer.
5 件のコメント
Mario Malic
2021 年 6 月 16 日
Please see the tutorials and simple apps, or maybe program it without App Designer at first. Once you're able to write the code, you can easily move it to App Designer.
Steps:
- Import the file in a variable or table with readtable
- Compare a single value with vector elements a == b. Output is logical array that may have true values on some indices
- Use info from step two to return the values you need.
Andrei Iulian
2021 年 6 月 16 日
Data in UITable component is held in property Data which is an array, so access third column of it this way
idx = app.EditField.Value == app.UITable.Data(:,3);
Idx will give you logical array.
a = [1 2 3 4];
b = 2;
idxRow = find(b == a)
Use it to index into particular row of the Data.
Andrei Iulian
2021 年 6 月 17 日
Mario Malic
2021 年 6 月 17 日
Show complete error. I don't see eq anywhere
回答 (0 件)
カテゴリ
ヘルプ センター および File 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!