MATLAB: How to count the number of rows in a csv file

#csv #rows

I am trying to iterate through the number of rows in a certain column in an excel document. How do i assign a variable called numRows that stores the number of rows with data in a csv file?

Best Answer

datatable = readtable('YourFile.csv', 'ReadVariableNames', false); %or true if there is a header
numRows = height(datatable);
Related Question