Why does the function 'str2double' run incorrectly
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Using the official example for the function 'str2double', an error is actually reported.
Examples are as follows:

Actual operation result:

2 Kommentare
Stephen23
am 20 Jun. 2023
Bearbeitet: Stephen23
am 20 Jun. 2023
Perhaps there are some invalid characters present in the strings. This often happens when users copy-paste examples from HTML documents (e.g. webpages) and inadvertently copy newlines or non-breaking spaces or something similar. Or some "smart" character replacement is provided by your OS: those decimal points certainly look strange (but that might just the font you are using).
So, check the character codes yourself. Or save the variable STR in a MAT file and upload it here by clicking the paperclip button, and we can show you how to check the character codes. We cannot run screenshots, we need your data.
Also show us the complete output of this command:
which str2double -all
Dyuman Joshi
am 20 Jun. 2023
Bearbeitet: Dyuman Joshi
am 20 Jun. 2023
Can you copy and paste the whole error?
What is the output when you run the following line of code in your MATLAB -
which str2double -all
Antworten (1)
Siehe auch
Kategorien
Mehr zu Characters and Strings 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!