Fill data with NaN for missing days
조회 수: 2 (최근 30일)
이전 댓글 표시
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!