listBoxの選択肢を変数から取得する方法
Show older comments
Matlab app designerにてListboxに表示する内容を変数から取得出来ますか?
エクセルファイルを読み込んでグラフを表示するアプリを作ろうと思います。
エクセルデータには大量のデータがあり、どのデータを表示するかを対話的に選択できるようにしたいです。
データの内容はエクセルファイルによって異なりますので、エクセルファイルの1行目に入っている計測データ名を取得し、それをリスト化することでどのデータを表示するかユーザーが選択できるようにしたいです。(下記のスクショのようなリスト変数txtを作成)
テキストの一行目の内容を変数に格納して、app.ListBox.Items = txtとすればいいのかと思いましたが、グレーの「編集不可」エリアになっているので出来なさそうです。
下記を実現する方法、もしくは代案何かありますでしょうか?
% Create ListBoxLabel
app.ListBoxLabel = uilabel(app.UIFigure);
app.ListBoxLabel.HorizontalAlignment = 'right';
app.ListBoxLabel.Position = [24 312 48 22];
app.ListBoxLabel.Text = 'List Box';
% Create ListBox
app.ListBox = uilistbox(app.UIFigure);
app.ListBox.Items = {'name1', 'name2'};
app.ListBox.Position = [87 262 100 74];
app.ListBox.Value = {};

Accepted Answer
More Answers (0)
Categories
Find more on スプレッドシート in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!