Fill data with NaN for missing days
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a matrix A in which I have number of days in first column and corresponding data in the second column. For example, A (1,1) = 1; A (1,2) = 0.1; A (2, 1) = 31; A (2, 2) = 0.2; A (3, 1) = 365; A (3, 2) = 0.25; The values in the first column 1, 31, and 365 are the days of a year i.e. January 1, January 31, and December 31, respectively. The values in the second column are the data for the corresponding days. For many days of the year, data is not available so the matrix A is incomplete. Now I want to create another complete matrix of size 365*2 (365 is the total no. of days in a year) in which I want to fill the rows with corresponding data from A when the data is available and fill with NaN when the data is not available. For example, I want to fill all days with NaN except Jan 1, Jan 31, and Dec 31 in this case since I don't have data for those period. Could you please advise a neat way to do this?
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical 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!