Borrar filtros
Borrar filtros

I want to import .txt file using GUI through Pushbutton and reading it and displaying the values of the text file, please suggest me the solution

4 visualizaciones (últimos 30 días)
Hello, i want to devolve a GUI where it should import .txt file through push button and read the file and display the values of the text file. Please help me to understand this. I have got import file code,
if true
[fileList, folder] = uigetfile('*.txt',...
'Find the File to Import', ...
'Multiselect', 'on').....
What should be here ...?
end
  2 comentarios
KSSV
KSSV el 9 de Abr. de 2018
How is your text file? If all numbers use load or importdata. If it also text have a look on textscan.
sandip bhagat
sandip bhagat el 9 de Abr. de 2018
Thanks for your quick reply, I have used that but not able to see imported values, results.
if true
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[fileList, folder] = uigetfile('*.txt',...
'Find the File to Import', ...
'Multiselect', 'on')
out = textscan(fileList,'%f %*s %*s\n%*s %*s %*s')
end

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by