我有一个mat数据,并提取了该文件的8个特征。我应该把这些功能排列成一个单元格,并重复12类我想把这个代码作为一个代码来排列和统一吗?
feature_mean1=zeros(12,15);
for vmean1= 1:12
feature_mean1(vmean1,:)= mean(Catrgoryy1{vmean1});
end
feature_mean2=zeros(12,15);
for vmean2= 1:12
feature_mean2(vmean2,:)= mean(Catrgoryy2{vmean2});
end
%**********************
%***************
feature_min1=zeros(12,15);
for vmin1= 1:12
feature_min1(vmin1,:)= min(Catrgoryy1{vmin1});
end
feature_min2=zeros(12,15);
for vmin2= 1:12
feature_min2(vmin2,:)= min(Catrgoryy2{vmin2});
end
%***************
X=zeros(30,4);
h=1;
X_1=[feature_mean1(1,:)',feature_std1(1,:)',feature_min1(1,:)',feature_max1(1,:)',feature_mean2(1,:)',feature_std2(1,:)',feature_min2(1,:)',feature_max2(1,:)'];%
Y_1=repmat(1,length(X_1),1);
%%%**************222*************
X_2=[feature_mean1(2,:)',feature_std1(2,:)',feature_min1(2,:)',feature_max1(2,:)',feature_mean2(2,:)',feature_std2(2,:)',feature_min2(2,:)',feature_max2(2,:)'];
Y_2=repmat(2,length(X_2),1);
%%%**************333**************
.
.
.
X_12=[feature_mean1(12,:)',feature_std1(12,:)',feature_min1(12,:)',feature_max1(12,:)',feature_mean2(12,:)',feature_std2(12,:)',feature_min2(12,:)',feature_max2(12,:)'];
Y_12=repmat(12,length(X_12),1);
首先必须为每个Features的8形式数组然后将它们全部插入for循环
for o=1:12
Xf(o,:)=[feature_mean11{o},feature_std11{o},feature_min11{o},feature_max11{o},feature_mean22{o},feature_std22{o},feature_min22{o},feature_max22{o}];
end
完成