|
发表于 2004-8-22 05:55:07
|
显示全部楼层
cell2num Convert a 2D cell array to a 2D numeric array
N = cell2num(C)
If the cells contain column vectors, they must have the same number of rows in each row of C.
Each column will be concatenated.
Example 1:
C = num2cell(rand(2,2))
[0.4565] [0.8214]
[0.0185] [0.4447]
N = cell2num(C)
0.4565 0.8214
0.0185 0.4447
Example 2:
C = cell(2, 3);
for i=1:2
for j=1:3
C{i,j} = rand(i, 1);
end
end
C =
[ 0.8998] [ 0.8216] [ 0.6449]
[2x1 double] [2x1 double] [2x1 double]
C{2,1} =
0.8180
0.6602
N=cell2num(C)
0.8998 0.8216 0.6449
0.8180 0.3420 0.3412
0.6602 0.2897 0.5341 |
|