Convert cell, containing decimal points as a comma, to double
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Fredrik
am 27 Sep. 2023
Kommentiert: Dyuman Joshi
am 27 Sep. 2023
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 Kommentare
Akzeptierte Antwort
Fredrik
am 27 Sep. 2023
Verschoben: Dyuman Joshi
am 27 Sep. 2023
1 Kommentar
Dyuman Joshi
am 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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!