我想将多个表存储在一个数组中。在下面的代码中,我创建了两个表T1
和T2
. 我想将这些表存储到一个变量MyArray
中。
LastName = {'Sanchez';'Johnson';'Li';'Diaz';'Brown'};
Age = [38;43;38;40;49];
Smoker = logical([1;0;1;0;1]);
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
T1 = table(LastName,Age,Smoker);
T2 = table(Height,Weight,BloodPressure);
% The code below does not work
MyArray(1) = T1;
MyArray(2) = T2;
我知道我可以使用元胞数组,但我想知道是否可以table
在 MATLAB 中创建数据类型数组。