How can I convert data in format cell to double?
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (3)
KSSV
il 20 Giu 2016
0 voti
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 Commento
Xinyuan Wei
il 20 Giu 2016
Shameer Parmar
il 20 Giu 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
il 21 Giu 2016
0 voti
Categorie
Scopri di più su Data Type Conversion in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!