Convert cell, containing decimal points as a comma, to double
9 views (last 30 days)
Show older comments
Hi all,
I have a cell vector with numbers where the decimal point is a comma. How do I convert these to numbers?
Let's use an example:
A = '-68,8';
I want to convert this to the number -68.8.
str2double(A) gives:
-688
str2num(A) gives:
-68 8
Can you please help me?
Best regards,
Fredrik (using R2021a)
0 Comments
Accepted Answer
Fredrik
on 27 Sep 2023
Moved: Dyuman Joshi
on 27 Sep 2023
1 Comment
Dyuman Joshi
on 27 Sep 2023
@Fredrik, since you found the solution before I posted my answer, I suggest you accept your own answer.
I will delete my answer after that.
More Answers (0)
See Also
Categories
Find more on Matrix Indexing 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!