Clear Filters
Clear Filters

I want data like this

4 views (last 30 days)
lokeswara reddy
lokeswara reddy on 12 Oct 2015
Commented: Walter Roberson on 12 Oct 2015
Dates Data
01-06-2014 2.088583333
02-06-2014 NaN
03-06-2014 2.264222222
04-06-2014 2.530666667
05-06-2014 2.494333333
06-06-2014 NaN
07-06-2014 2.429666667
08-06-2014 2.3515
09-06-2014 NaN
10-06-2014 3.879833333
11-06-2014 5.84
12-06-2014 NaN
13-06-2014 NaN
14-06-2014 3.177583333
15-06-2014 NaN
16-06-2014 3.523666667
17-06-2014 3.198416667
18-06-2014 2.109083333
19-06-2014 NaN
20-06-2014 1.520833333
21-06-2014 1.269666667
22-06-2014 NaN
23-06-2014 1.125583333
24-06-2014 1.076666667
25-06-2014 1.071333333
26-06-2014 1.029166667
27-06-2014 1.121333333
28-06-2014 NaN
29-06-2014 1.06175
30-06-2014 1.083
01-07-2014 1.273666667
02-07-2014 1.32975
03-07-2014 0.875640097
04-07-2014 NaN
05-07-2014 0.771616244
06-07-2014 0.667592391
07-07-2014 NaN
08-07-2014 0.563568539
I want data like this
Date Data
01-06-2014 2.088583333
02-06-2014 NaN
03-06-2014 2.264222222
04-06-2014 2.530666667
05-06-2014 2.494333333
06-06-2014 NaN
07-06-2014 2.429666667
08-06-2014 2.3515
09-06-2014 NaN
10-06-2014 3.879833333
11-06-2014 5.84
12-06-2014 NaN
13-06-2014 NaN
14-06-2014 3.177583333
15-06-2014 NaN
16-06-2014 3.523666667
17-06-2014 3.198416667
18-06-2014 2.109083333
19-06-2014 NaN
20-06-2014 1.520833333
21-06-2014 1.269666667
22-06-2014 NaN
23-06-2014 1.125583333
24-06-2014 1.076666667
25-06-2014 1.071333333
26-06-2014 1.029166667
27-06-2014 1.121333333
28-06-2014 NaN
29-06-2014 1.06175
30-06-2014 1.083
01-07-2014 1.273666667
02-07-2014 1.32975
03-07-2014 0.875640097
04-07-2014 NaN
05-07-2014 0.771616244
06-07-2014 0.667592391
07-07-2014 NaN
08-07-2014 0.563568539
  1 Comment
Walter Roberson
Walter Roberson on 12 Oct 2015
What you have and what you want appear to be the same to me.

Sign in to comment.

Answers (8)

Stalin Samuel
Stalin Samuel on 12 Oct 2015
d1 = datenum('01 June 2014');%starting date
d2 = datenum('08 July 2014');%End date
dates = d1:d2;%Dates from starting to end
s = numel(dates);%Total no of days
data = rand(s,1);% your data
tsobj = fints(dates', data, {'data'},'Daily','')%creating time series

Walter Roberson
Walter Roberson on 12 Oct 2015
Provided that your dates are a cell array of strings, then
dv = datevec(dates);
what_you_want = dv(:,3);
  1 Comment
lokeswara reddy
lokeswara reddy on 12 Oct 2015
Edited: lokeswara reddy on 12 Oct 2015
I want to generate data like this

Sign in to comment.


Stalin Samuel
Stalin Samuel on 12 Oct 2015
Edited: Stalin Samuel on 12 Oct 2015
d1 = datenum('01 June 2014');
d2 = datenum('01 June 2024');
dates = d1:d2;
ur_days = day(dates');

lokeswara reddy
lokeswara reddy on 12 Oct 2015
Thank you Mr. Stalin Samuel for your response

lokeswara reddy
lokeswara reddy on 12 Oct 2015
Edited: Walter Roberson on 12 Oct 2015
I want to generate the Days like this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
up to
10 years days in a single column with includes leap yearsalso.
thank you

lokeswara reddy
lokeswara reddy on 12 Oct 2015
Edited: lokeswara reddy on 12 Oct 2015
Thank you so much Mr. Stalin Samuel it's working

lokeswara reddy
lokeswara reddy on 12 Oct 2015
Please find this attachment and replay me thank you
  1 Comment
Walter Roberson
Walter Roberson on 12 Oct 2015
You have changed your requirements too many times; I have dropped out of the discussion.

Sign in to comment.


Stalin Samuel
Stalin Samuel on 12 Oct 2015
[num,txt,raw] = xlsread('date_1.xls');
req = raw(3:24,1:2); %selsect process data date and data
req1 = cell2mat(raw(3:24,2)) %Only data
d1 = datenum(req(:,1),'dd-mm-yyyy')%only date
tmp = d1(1):d1(end);%Total dates
isSubset =ismember(tmp,d1); %find missing date
m = 1;
for i = 1:numel(tmp)
if isSubset(i)==1 %for actual dates and data
data(i,:) =(tmp(i));
val(i) = req1(m);
else %for mssing dates and data
data(i,:) =tmp(i);
val(i) = 0;
end
end
result = fints(data,val')
%Unable to add NaN....

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!