1.创建一个元胞数组testcell
方式1:
testcell = cell(2,3);
testcell{1,1} = {'monday','mon'};
testcell{1,2} = {'tuesday ','tue'};
testcell{1,3} = {'wednesday','wed'};
testcell{2,1} = {'thursday','thu'};
testcell{2,2} = {'friday','fri'};
testcell{2,3} = {'saturday','sat'};
方式2:
testcell = { {'monday','mon'},{'tuesday ','tue'},{'wednesday','wed'};{'thursday','thu'},{'friday','fri'},{'saturday','sat'}};
2.读取元素
>> testcell(1,1)
ans =
1×1 cell 数组
{1×2 cell}
>> testcell{1,1}(1,1)