how to convert a numeric matrix to cell array without changing its property?

2 次查看(过去 30 天)
i have a training matrix A of dimension 384x4160, inorder to create labels and supply it as a input to the svmtrain function, i have converted the matrix to a cell array using the following command,
train_cell={train(1:64,:),train(65:128,:),train(129:192,:),train(193:256,:),train(257:320,:),train(321:384,:)};
it has given me a 1x6 cellarray say (B) of the following dimension,
64x4160 double 64x4160 double 64x4160 double 64x4160 double 64x4160 double 64x4160 double
As per the svm documentation the train matrix must be a numeric array, but after the conversion of matrix to cell array using the above command, the cellarray becomes non-numeric. i.e when i give
isnumeric(train_cell)
the answer is,
ans =
logical
0
Kindly, suggest me how to convert the matrix to cellarray by holding its numeric property.

回答(1 个)

Jan
Jan 2017-12-26
编辑:Jan 2017-12-26
You can't. A cell array is by definition a cell array, while only numerical arrays are numerical arrays.
As per the svm documentation the train matrix must be a numeric array, ...
Exactly. Then a conversion to a cell is not a valid option.
What is the actual problem you want to solve? What does this exactly mean: "in order to create labels and supply it as a input"?

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by