How count a number of rows in a table (meteorologica data)?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kaleb Ribeiro
am 8 Sep. 2021
Kommentiert: Star Strider
am 8 Sep. 2021
My goal is to create an array that counts the number of rows each day of the year, to identify which days I should include blank lines in the final table. Some of the days have the correct amount of points (48 per day), so some do not. I wrote this script with the intention of doing but I’m not getting it. Could someone help me?
doy = data (:,3); % Column of the Julian Days (1,2,3,...,366). Each day has the value repeated by 48 rows of the matrix (data).
cont_doy = zeros(366,2); % matrix that receives the row count each day
cont_doy(:,1) = 1:366;
for i = 1:366;
id = find (data(:,3) == i);
cont_doy(:,2) = size(id, 1)
end
0 Kommentare
Akzeptierte Antwort
Star Strider
am 8 Sep. 2021
3 Kommentare
Image Analyst
am 8 Sep. 2021
You can use height to get the number of rows in a table
rowsInTable = height(yourTable);
If you have an array instead of a table, you can use size
rowsInTable = size(yourArray, 1);
Star Strider
am 8 Sep. 2021
@Kaleb Ribeiro — The retime funciton will interplate, and fill the missing data with interpolated values or a constant (such as NaN), so that the days all have the same numbers of entries.
.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!