Is this even possible?

조회 수: 4 (최근 30일)
Tim
Tim 2013년 6월 20일
I am attempting to read in a .exp file to Matlab. I'm pretty mediocre with Matlab, but I will try to explain what I have tried to the best of my abilities.
filename,pathname] = uigetfile('*.exp', ...
'Select a data file', ...
%mypathhere);
fid = fopen(filename,'r+');
I've managed to be able to get a value for fid other than -1 with this, but the file is always empty when i open it in matlab. It isn't empty outside of matlab however. I'm not sure if it is having problems because the .exp file contains both numerical and non numerical characters, but it's been very frustrating. Any help is appreciated

답변 (1개)

Kye Taylor
Kye Taylor 2013년 6월 20일
Have you tried right-clicking on the file from the current folder browser? In the context-menu that pops up you should see something like "Import Data," but I'm not sure MATLAB will recognize it as a text file.
  댓글 수: 2
Tim
Tim 2013년 6월 20일
Yes, I really want a way around having to do that as there are a large number of files to run through the code. Thank you, though.
Kye Taylor
Kye Taylor 2013년 6월 20일
Ahh very good. So, you've got numbers and letters in the same file (that is essentially a text file)? Checkout the textscan function. I can give you more direction if you provide a snippet of the file.

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

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by