Hi all.Iam having a function like the one given below
v = importdata('myfile.txt'); V1 = v(:,1); v2 = v(:,2);
Here, instead of writing the file name in the program I want to give the file as an input through gui.so I created a gui with a browse button .How do I import the file name into the function
% launch GUI
my_gui;
% get the handle to the GUI and wait for it to be closed
waitfor(my_gui);
% continue with script
Now it is showing me an error. "error in importdata"like this. what should I do now. Help me out

 採用された回答

Jan
Jan 2017 年 5 月 18 日

0 投票

Do not leave the GUI. Select a file inside the GUI, store it in the handles struct (see the bunch of threads concerning "share data between callbacks") and use a button like "Open file" to start the import.
Having a GUI, but closing it to start the computations, is not convenient or user friendly. Look how porfessional software works.

その他の回答 (0 件)

カテゴリ

質問済み:

2017 年 5 月 18 日

回答済み:

Jan
2017 年 5 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by