ボタン(アプリで使用)のファイル選択操作について
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
アプリを起動し、csvファイルを読み込む際の操作についてですが、
デフォルトでは「開くファイルを選択」→「すべてのMATLABファイル(*.mlb・・・)」です
毎回、「すべてのファイル(*.*)」に選択し直しております
以下の記述かと思いますが、最初から「すべてのファイル(*.*)」にするオプションがありましたら
ご教示下さい
% Button pushed function: Button
function Filename(app, event)
2 Commenti
Hernia Baby
il 29 Set 2022
これって「ホーム > 変数 > データのインポート」の事を言ってますか?もしくはappdesighner等でアプリを作って何かしらの関数を起動させようとしてますか?
Risposta accettata
Kojiro Saito
il 21 Ott 2022
uigetfileをアプリのボタンプッシュのコールバックに入れれば実現できます。
uigetfileだけでは「すべてのMATLABファイル (*.mlb…)」になってしまうので、uigetfile('*.*')とします。
% Button pushed function: Button
function ButtonPushed(app, event)
[file,path] = uigetfile('*.*');
if isequal(file,0)
disp('User selected Cancel');
else
disp(['User selected ', fullfile(path,file)]);
end
end
CSV ファイルのみ許可したいなら、uigetfile('*.csv')としておくと良いかもしれません。
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!