'Conversion to cell from double is not possible.' During table assignement
    7 ビュー (過去 30 日間)
  
       古いコメントを表示
    
Hello,
I have encountered this problem in one of my codes (reproduced here with simple data) : 
vect =  [1 2 4 3]; % creating a vector
mat = [vect;vect]; % juste a simple matrix
% initialising a table
varnames = {'SomeTableCellData'};
vartypes = {'cell'};
Table = table('Size',[0 length(varnames)],'VariableTypes',vartypes,'VariableNames',varnames);
% this works
Table(1,'SomeTableCellData') = {mat};
% this doesn't work
Table(2,'SomeTableCellData') = {vect};  
But both {mat} and {vect}  are cell arrays containing double, so I'm a bit lost as why this happens.
Thanks for your help.
2 件のコメント
  Stephan
      
      
 2020 年 11 月 25 日
				
      編集済み: Stephan
      
      
 2020 年 11 月 25 日
  
			Does work with a column vector:
vect =  [1 2 4 3]'; % creating a vector and transpose it
mat = [vect, vect]; % juste a simple matrix
% initialising a table
varnames = {'SomeTableCellData'};
vartypes = {'cell'};
Table = table('Size',[0 length(varnames)],'VariableTypes',vartypes,'VariableNames',varnames);
% this works
Table(1,'SomeTableCellData') = {mat};
% this doesn't work
Table(2,'SomeTableCellData') = {vect};  
採用された回答
  Raunak Gupta
    
 2020 年 12 月 4 日
        Hi, 
I have brought this issue (with the row vector while assignment to a table) to the notice of our developers. They will investigate the matter further. 
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Data Type Conversion についてさらに検索
			
	製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


