how to take out may to october months data from 4-d data.

1 回表示 (過去 30 日間)
devendra
devendra 2014 年 8 月 20 日
コメント済み: the cyclist 2014 年 8 月 21 日
sir i have four dimension daily precipitation data prec(20,22,365,96)lon,lat,day,time.how can take out may to october months from each years.please help me.
  2 件のコメント
dpb
dpb 2014 年 8 月 20 日
In what form are the dates given?
devendra
devendra 2014 年 8 月 20 日
編集済み: devendra 2014 年 8 月 21 日
1/1/2005 to 31/12/2100 sir ,thank you sir in advance,

サインインしてコメントする。

回答 (1 件)

the cyclist
the cyclist 2014 年 8 月 20 日
編集済み: the cyclist 2014 年 8 月 20 日
I don't fully understand your data layout, but this example should help you do what you want:
% Create some example data
dateList = {'2001-01-01','2001-02-01','2001-03-01','2001-04-01','2001-05-01','2001-06-01','2001-07-01','2001-08-01','2001-09-01','2001-10-01','2001-11-01','2001-12-01'}';
% Create matrix with numeric year,month,day, etc
dateVector = datevec(dateList);
% Isolate the month
monthVector = dateVector(:,2);
% Find the months from May through Oct
indexToMayThruOct = ismember(monthVector,[5:10]);
% Purge those data from the original list
dateList(indexToMayThruOct) = [];
  4 件のコメント
devendra
devendra 2014 年 8 月 21 日
but i have 4d (dimension) data (lon lat day year) how can take out from data,please help me,thank you in advance.
the cyclist
the cyclist 2014 年 8 月 21 日
@devendra, is your data really 4-dimensional, or is it actually 2-dimensional with 4 columns?
What is the variable type that stores your data? Is it a cell array?
Maybe this is closer to what you need. You need to try to understand the answer, not just apply it blindly.
Also, it would be useful for you to post a small example of your data.
% Create matrix with numeric year,month,day, etc
dateVector = datevec(prec(:,3));
% Isolate the month
monthVector = dateVector(:,2);
% Find the months from May through Oct
indexToMayThruOct = ismember(monthVector,[5:10]);
% Purge those data from the original list
prec(:,indexToMayThruOct) = [];

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by