필터 지우기
필터 지우기

Read software data files.

조회 수: 2 (최근 30일)
Zhanhong
Zhanhong 2011년 7월 5일
I'm dealing with various software data files. When I try to open the files in wordpad there are normal English characters and some wired characters, seems they are all ASCII characters with ANSI number from around 200 to 255. Something look like "ÿÿÿÿ". I think the data must be stored in those characters but I don't know how to read those data into MATLAB since I don't have too much experience with data format handling. Thanks for your help.
  댓글 수: 1
Fangjun Jiang
Fangjun Jiang 2011년 7월 5일
What is your data file look like? How do you want to process it? Just read it as string or do you have some numeric data? You need to specify your question. MATLAB can read ASCII value 200 to 255 characters.
>> char(200:255)
ans =
ÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ

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

답변 (1개)

Rick Rosson
Rick Rosson 2011년 7월 5일
Please try the following:
filename = 'myfile.txt';
txt = fopen(filename,'r');
aStr = fscanf(txt,'%s');
fclose(txt);
ascii = uint8(aStr);
disp(ascii');
HTH.

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by