a=[1,2,3;4,5,6];
b=[7;8];
c=[a,b];
a={1,2,3;4,5,6};
b={7;8};
c=[a,b];
wen2_sixlei = ["花菜类" "花叶类" "辣椒类" "茄类" "食用菌" "水生根茎类"];
wen = cname + ["的销量和"];
name=["花菜类" "花叶类" "辣椒类" "茄类" "食用菌" "水生根茎类" "常数"]';
e="&"+name+"&"+d(:,1)+"&"+d(:,2)+"&"+d(:,3)+"&"+d(:,4)+"&"+d(:,5)+"\\";
T = table([1;2;3],[2 8; 4 10; 6 12],[3 12 21; 6 15 24; 9 18 27],...
'VariableNames',{'One' 'Two' 'Three'})
T = table(categorical({'M';'M';'F';'F';'F'}),[38;43;38;40;49],...
[71;69;64;67;64],[176;163;131;133;119],...
'VariableNames',{'Gender' 'Age' 'Height' 'Weight'})
T = table(ones(2,1,3),2*ones(2,2,3),3*ones(2,3,3),...
'VariableNames',{'One' 'Two' 'Three'})
City = {'QiangDao','JiNan','YanTai'}';
Pre = [800,600,800]';
Tmean = [20,23,21]';
CityTable1 = table(City,Pre,Tmean);
% table1
clc,clear
City = {'QiangDao','JiNan','YanTai'}';
Pre = [800,600,800]';
Tmean = [20,23,21]';
CityTable1 = table(City,Pre,Tmean);
% table2
City = {'Nanjing','SuZhou','WuXi'}';
Pre = [900,800,900]';
Tmean = [23,25,26]';
CityTable2 = table(City,Pre,Tmean);
% table的按行合并-union
CityTable = union(CityTable1,CityTable2,'stable'); % 'stable'表示按照原始table中的顺序合并,不重新排序
City = {'Nanjing','SuZhou','WuXi'}';
Pre = [900,800,900]';
Tmean = [23,25,26]';
CityTable2 = table(City,Pre,Tmean);
a={1;2;3};
b=[CityTable2,a];
b.Properties.VariableNames = ["City","Pre","Tmean","shuju"];
1.b=[CityTable2,a];table型拼接
2.b.Properties.VariableNames = [“City”,“Pre”,“Tmean”,“shuju”];修改变量名
``
c=b.shuju;
d=b.City;
调用后:
namelist = dir([path,‘*.csv’]);