Finding the column and row

6 visualizzazioni (ultimi 30 giorni)
Shinhyeon Kim
Shinhyeon Kim il 21 Set 2021
Risposto: Cris LaPierre il 21 Set 2021
Hi. I just want to change my table(data) to matrix.
But whenever I code data = data{ : , : } it says "Unable to concatenate the table variables 'Sampler' and 'Var3', because their types are double and cell."
What should I do in this case?
%%
for i =1:length(path)
file2load = strcat(path(i).folder,'/',path(i).name);
data = readtable (file2load);
data=data{:,:};
end

Risposte (1)

Cris LaPierre
Cris LaPierre il 21 Set 2021
One feature of a table is that your columns can be different data types (e.g. a double and a cell).
In a matrix, all your data must be of the same data type.
The solution is to either convert your doubles to cells or your cells to doubles before converting your table to a matrix.

Categorie

Scopri di più su Tables in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by