필터 지우기
필터 지우기

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 (최근 30일)
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
KSSV
KSSV 2018년 4월 9일
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 2018년 4월 9일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by