How can I convert data in format cell to double?
Afficher commentaires plus anciens
How can I conver the data in format cell attached here to double? I tried function double. It works well for some of my data but not this file. I cannot not understand what is the difference.
Réponse acceptée
Plus de réponses (3)
KSSV
le 20 Juin 2016
0 votes
It is because..if you see your first dataset in X it is 'G3'. As it is a string, MATLAB is showing error to convert to double. You delete the first dataset 'G3' then double shall work.
1 commentaire
Xinyuan Wei
le 20 Juin 2016
Shameer Parmar
le 20 Juin 2016
As the 'X' is in dataset format, so you need to create new variable by fetching data for 'X'.
first load your .mat file, then run the following code..
for i = 1: length(X)
x(i) = str2num(X{i,1});
end
x = x';
Xinyuan Wei
le 21 Juin 2016
0 votes
Catégories
En savoir plus sur Data Type Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!