Error with cell2mat
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I receive the following error from Matlab when using the cell2mat function: "Cell contents reference from a non-cell array object. cellclass = class(c{1});"
The code works with excel, which give a matrix to Matlab. When the numeric matrix is imported by Matlab it is in the cell format. Then I use the cell2mat function to convert it in double.
The line of the error is the following:
Data=cell2mat(price);
If I use the same line in the command window (with the same numeric matrix imported from excel) it works.
I don't understand where is the mistake.
Thanks
0 件のコメント
回答 (1 件)
Star Strider
2016 年 6 月 16 日
‘I don't understand where is the mistake.’
We don’t either, because we don’t have your code or your Excel file. Having those to refer to and experiment with would help significantly.
2 件のコメント
Star Strider
2016 年 6 月 20 日
I cannot give you an exact response because I do not have whaterver ‘price’ is. The error leads me to believe that ‘price’ is not a cell array.
See if just referring to ‘price’ rather than ‘cell2mat(price)’ does what you want.
If not, you may have to experiment with other ways of converting it to a double array, depending on the class of variable it is.
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!