How can I convert data in format cell to double?
Show older comments
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.
Accepted Answer
More Answers (3)
KSSV
on 20 Jun 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 Comment
Xinyuan Wei
on 20 Jun 2016
Shameer Parmar
on 20 Jun 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
on 21 Jun 2016
0 votes
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!