'Conversion to cell from double is not possible.' During table assignement
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Valentin LAPLAUD
am 25 Nov. 2020
Beantwortet: Raunak Gupta
am 4 Dez. 2020
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 Kommentare
Stephan
am 25 Nov. 2020
Bearbeitet: Stephan
am 25 Nov. 2020
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};
Akzeptierte Antwort
Raunak Gupta
am 4 Dez. 2020
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!