ドロップダウンボックスの選択肢について

表題の件についてご教示いただきたいです。
App Designerでアプリを作成しているのですが、ドロップダウンボックスの選択肢を選択する際( function DropDownOpening(app, event)以降)添付CSVのようなCSVを読み込み、2行目の値が1であれば1行目の内容がドロップダウンボックスの選択肢として表示され、0であれば空白または非表示となるようなプログラミングを作成したいのですが、アドバイスいただけないでしょうか?
調べてもあまりドロップダウンボックスの選択肢を条件によって変化させる方法がないため。
宜しくお願いします。

 Risposta accettata

Hernia Baby
Hernia Baby il 4 Mar 2023

1 voto

簡単なデモファイルを作成しました(添付)。
ボタンを押すと以下のようなプログラムが動きます。
[filename,path] = uigetfile("*.csv","データを選択");
A = readtable(fullfile(path,filename));
idx = A.Value == 1;
app.DropDown.Items = table2cell(A(idx,1));

1 Commento

A.T
A.T il 7 Mar 2023
ありがとうございます!解決しました!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su App Designer を使用したアプリ開発 in Centro assistenza e File Exchange

Richiesto:

A.T
il 3 Mar 2023

Commentato:

A.T
il 7 Mar 2023

Community Treasure Hunt

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

Start Hunting!