Can I use DOS command to read a file line by line in my Matlab Script? Is it possible in matlab to use?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a text file and I want to read the file using the windows compiler(command window), and the line should be stored into a variable. Pl let me know if matlab supports for this functionality.
Thank you!
댓글 수: 0
답변 (1개)
Image Analyst
2014년 2월 3일
What you say doesn't really make sense. But I think you'll find what you're looking for with the fgetl() function. There's an example in the help there that should do what I think you want to do.
fid = fopen('fgetl.m');
tline = fgetl(fid);
while ischar(tline)
disp(tline)
tline = fgetl(fid);
end
fclose(fid);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!