Assigning data type to a new table variable
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Bryan Wilson
am 15 Nov. 2016
Kommentiert: Peter Perkins
am 18 Nov. 2016
I have table T and have added a variable var3. The new variable is initiated empty. When I try to add data to it later, I get the following error.
Conversion to cell from double is not possible.
When I create the variable, how can I change the default data type from cell to double (or any other data type)?
1 Kommentar
Image Analyst
am 15 Nov. 2016
How did you add the new var3 column to the table variable? And how did you try to add data to that column, and what kind of data was it (strings, or numbers)?
Akzeptierte Antwort
Bryan Wilson
am 15 Nov. 2016
1 Kommentar
Peter Perkins
am 18 Nov. 2016
Depending on what you're doing, it might be better to start with a 0x1 in the numeric case. So
T.Var3 = zeros(height(T),1);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing 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!