用MATLAB制造时间维度数据
来源:互联网 发布:linux管道原理 编辑:程序博客网 时间:2024/04/27 22:29
%generate date_data
date=datestr(datenum(2010,1,1):datenum(2012,12,31),29);%using 29---iso define
vector=datevec(date);
vector=vector(:,1:3);
month=vector(:,2);
quarter=zeros(length(month),1);
for i=1:length(month)
switch month(i)
case {1,2,3}
quarter(i)=1;
case{4,5,6}
quarter(i)=2;
case{7,8,9}
quarter(i)=3;
case{10,11,12}
quarter(i)=4;
end
end
englishmonthname=cell(length(month),1);
for i=1:length(month)
switch month(i)
case 1
englishmonthname{i}='January';
case 2
englishmonthname{i}='February';
case 3
englishmonthname{i}='March';
case 4
englishmonthname{i}='April';
case 5
englishmonthname{i}='May';
case 6
englishmonthname{i}='June';
case 7
englishmonthname{i}='July';
case 8
englishmonthname{i}='August';
case 9
englishmonthname{i}='September';
case 10
englishmonthname{i}='October';
case 11
englishmonthname{i}='November';
case 12
englishmonthname{i}='December';
end
end
[w,d]=weekday(date);
vector=mat2cell(vector,ones(size(vector,1),1),ones(size(vector,2),1));
quarter=num2cell(quarter);
w=num2cell(w);
d=cellstr(d);
date=cellstr(date);
datekey=transpose(num2cell(1:length(date)));
output=cat(2,datekey,date,vector,quarter,englishmonthname,w,d);
%generate datetime_data
date=datestr(datenum(2010,1,1):datenum(0,0,0,1,0,0):datenum(2012,12,31));
vector=datevec(date);
vector=vector(:,1:4);
month=vector(:,2);
quarter=zeros(length(month),1);
for i=1:length(month)
switch month(i)
case {1,2,3}
quarter(i)=1;
case{4,5,6}
quarter(i)=2;
case{7,8,9}
quarter(i)=3;
case{10,11,12}
quarter(i)=4;
end
end
englishmonthname=cell(length(month),1);
for i=1:length(month)
switch month(i)
case 1
englishmonthname{i}='January';
case 2
englishmonthname{i}='February';
case 3
englishmonthname{i}='March';
case 4
englishmonthname{i}='April';
case 5
englishmonthname{i}='May';
case 6
englishmonthname{i}='June';
case 7
englishmonthname{i}='July';
case 8
englishmonthname{i}='August';
case 9
englishmonthname{i}='September';
case 10
englishmonthname{i}='October';
case 11
englishmonthname{i}='November';
case 12
englishmonthname{i}='December';
end
end
[w,d]=weekday(date);
vector=mat2cell(vector,ones(size(vector,1),1),ones(size(vector,2),1));
quarter=num2cell(quarter);
w=num2cell(w);
d=cellstr(d);
date=cellstr(datestr(date,'yyyy-mm-dd HH:MM:SS'));%or use datestr(date,31)
datekey=transpose(num2cell(1:length(date)));
output=cat(2,datekey,date,vector,quarter,englishmonthname,w,d);
save('input.mat','output');
- 用MATLAB制造时间维度数据
- 创建时间维度数据
- 创建时间维度数据
- 制造数据
- db2通过游标生成时间维度表数据
- Oracle中创建时间维度表并插入数据
- 数据仓库时间维度
- 时间维度创建
- Cube中时间维度
- 数据仓库的时间维度
- HBase中的时间维度
- 关注时间维度
- Oracle创建时间维度
- HBase中的时间维度
- HBase中的时间维度
- mysql时间维度表。
- My97datepicker时间维度切换
- 怎样制造时间机器
- 基于open source工具所构建的过程管控体系
- 说说结婚~
- x
- C#中Socket的运用
- 利用Spring进行Quartz定时开发的两种方式进行讲解
- 用MATLAB制造时间维度数据
- 快速排序及其优化
- 如何通过socket发送和接受dataset数据集(C#)
- 大话设计模式(五)代理模式
- Perl VS PHP
- Advanced C++ Topics
- 简单DShow Demo
- 使用visio 绘制的e-r 图
- [noip2001p2]最大公约数与最小公倍数问题