how to convert 66 x 2 cell array into matrix

1 次查看(过去 30 天)
a =
16 282
54 96
64 134
70 52
87 108
88 135
97 266
101 42
104 84
106 53
107 174
114 262
116 57
123 169
124 87
124 260
138 77
139 60
141 23
143 81
149 230
153 246
161 222
163 147
163 268
169 21
169 121
173 185
174 36
176 67
176 275
177 246
191 71
194 48
203 36
205 101
209 118
209 224
212 64
213 104
218 32
221 81
223 109
228 32
228 130
235 61
236 132
238 73
243 203
246 66
247 156
260 131
260 176
261 229
262 152
269 236
272 187
279 159
280 174
289 69
291 39
292 96
294 121
305 266
306 335
312 301
I got an error when I convert cell into matrix
c=cell2mat(a);
  3 个评论
Ei Ei Mon
Ei Ei Mon 2017-7-11
I have a cell array of size 66X2 double. I want to change this cell array into matrix using cell2mat. But I got an error: Cell contents reference from a non-cell array object. Error in cell2mat (line 42) cellclass = class(c{1});
KSSV
KSSV 2017-7-11
That's what my questions is: you have a cell array of size 66X2 and each cell got what values?

请先登录,再进行评论。

采纳的回答

Rik
Rik 2017-7-11
A cell array will not show up as "66X2 double". Only a matrix of type double (the standard type) will do that. So the answer is that cell2mat fails, because a already is a matrix.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by