I need to use 'for loop' to read the names from a text file using 'fgetl' function. How do I do that?
이전 댓글 표시
There is a list of 80 test subject names in a text file, and I have to use the for loop function to read the names of the first 40 subjects using fgetl function. How do I write the code in MATLAB.
Thanks!!
댓글 수: 2
anukriti dureha
2013년 6월 2일
do u specifically have to use for???... or u can use while loop too?
kiran sai kadiyala
2020년 2월 21일
clear all
close all
clc
%importing data
f1=fopen('your_file.dat','r')
%n=no of rows in your file
n=218;
for i=1:n;
ab{i}=fgetl(f1);
end
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!