Gistlib Logo

gistlib

how to write a for loop to loop to the end of a file in matlab

main.m
fid = fopen('myfile.txt','r');
while ~feof(fid)
    line = fgetl(fid);
    % Add your code here to process the current line
end
fclose(fid);
141 chars
7 lines

similar matlab code snippets

loop through all files in folder and list those which end with .m in matlab
how to replace each element in a array with the row of another array in matlab
calculate the frequency of letters in words in matlab
while loop in matlab
how to count from -1 to 101 in matlab
implement factorial in matlab
find the thirteen adjacent digits in the 1000-digit number that have the greatest product. what is the value of this product? in matlab
loop to find integers in matlab
how to replace each element of a array with the row cell of another array in matlab
make a random 100-by-100 matrix in matlab

related categories

matlab
file-io
loops

gistlibby LogSnag