Dar*_*uuk 23
方括号创建向量或矩阵,而大括号创建单元格数组.
使用数字时,我会说99%的时间,你会使用方括号.单元格数组允许您在每个位置存储不同类型的数据,例如(1,1)处的10x5矩阵,(1,2)处的字符串数组,...
x = [1 2 3]; #% matrix with values 1, 2, 3
y = {1, 'a', x}; #% cell array storing a number, a character, and 1x3 matrix
Run Code Online (Sandbox Code Playgroud)
以下是有关单元阵列的MATLAB文档:http://www.mathworks.com/help/matlab/cell-arrays.html