How can I split an array of float point numbers in two different arrays based on a dot (.) delimiter?
Ältere Kommentare anzeigen
Hi all,
I try to spilt an array of float point numbers in two different arrays based on a dot (.) delimiter but it does not work. I do the following steps:
1- Convert an array of float point numbers to be as a string.
2- spilt a string based on a dot (.) delimiter.
This is not work and shows the following error:
Error using strsplit (line 80) First input must be a string.
Error in decompose (line 8) C = strsplit(str,'.');
Sorry if there is any spelling errors. I am beginner in Matlab.
Thanks in advance!
Akzeptierte Antwort
Weitere Antworten (1)
Chandrasekhar
am 15 Apr. 2014
0 Stimmen
numbers can be converted into strings using 'num2str' command and they can be splitted using 'strtok' command
1 Kommentar
Walter Roberson
am 15 Apr. 2014
num2str() uses a default format that might not be suitable -- though you can specify a format as the second parameter.
regexp() with the 'split' option can also be used to split strings.
Kategorien
Mehr zu Data Type Identification finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!