필터 지우기
필터 지우기

Reading a text file and saving as a 3x5 array problems?

조회 수: 1 (최근 30일)
Victoria Smith
Victoria Smith 2021년 4월 5일
댓글: Rik 2021년 4월 6일
I'm not sure how to get matlab R2019a to read and save this text file as an array? All the examples people have uploaded and found answers to don't actually seem to print the values for me.
To be more specific, I would like the 5 lines to be displayed;
1.80 352 N Calm
2.70 346 N Light Air
3.60 346 N Light Air
2.70 346 N Light Air
2.70 346 N Light Air
  댓글 수: 7
Victoria Smith
Victoria Smith 2021년 4월 6일
Which exact line? What do you mean sorry? I just rerouted the readfile.m file to my path - do I have to change every single "filename" in the file to 'datalog.txt'?
Rik
Rik 2021년 4월 6일
It sounds like you would benefit from a basic Matlab tutorial.
filename='datalog.txt';
raw_data=readfile(filename);
Then you can do the parsing of each line.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by