필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to read file a text file with numbers and characters in a loop

조회 수: 1 (최근 30일)
perveen ali
perveen ali 2017년 1월 26일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi there, can someone please help me with reading the .txt file in a loop, what is best function. thanks.

답변 (2개)

Guillaume
Guillaume 2017년 1월 26일
There is no generic function in matlab that will magically read this type of file. You will have to parse it yourself, either by reading it one line at a time (using low level IO such as fopen, fgetl, fclose, etc.) or reading the whole file as a continuous string ( fileread) and using regular expressions for the parsing.
Either way, you should use the documentation of whatever program was used to generate that text file to understand its structure. It appears to be made of different section (for each lens?) but the format is not consistent between sections. Hence you'll have to refer to that program documentation to make a reliable parser.

perveen ali
perveen ali 2017년 1월 26일
Hi Guillaume, please ignore first data file. I have attached this one which is systematic. thanks.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by