how to add missing months in loop?

1 次查看(过去 30 天)
SONI SONI
SONI SONI 2015-2-18
编辑: Stephen23 2015-2-18
I have a monthly soil moisture data of 10 year in hdf format. The data file contains 105 hdf file, 15 months are missing. The dimension of matrix is 180*360 now I want to create this matrix in 180*360*120. How could I add missing months in a loop.
  2 个评论
Stephen23
Stephen23 2015-2-18
编辑:Stephen23 2015-2-18
Your question is not clear: Do you want to interpolate your data for the missing dates, or just complete the list of dates so that there are none missing?
SONI SONI
SONI SONI 2015-2-18
I repeat my question..... I have global soil moisture data of 105 months (15 months missing out of 10 year). Dimension of data is 180*360 and format is hdf. Now I need to infile all the data (105) and then want add 15 missing months. so finally dimension of result will be 180*360*120 that will show a complete time series of 10 year.

请先登录,再进行评论。

回答(1 个)

Stephen23
Stephen23 2015-2-18
编辑:Stephen23 2015-2-18
Use one of the interpolation tools , filling in missing data is exactly what they can do. Which tool you select depends on the shape of your data, and your own requirements for the "filling" in of the data. For a start, try interp1 .
Note that you can interpolate all of the data at once, without loops, by using the matrix input of most of these functions, eg for interp1: If you have multiple sets of data that are sampled at the same point coordinates, then you can pass v as an array. Each column of array v contains a different set of 1-D sample values.
Note that interpolation does not require any loops, even though you put this in the question title.

类别

Help CenterFile Exchange 中查找有关 Genomics and Next Generation Sequencing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by