Working with phone number data. Number to String
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Using a bunch of data from an excell sheet im reading in phone numbers to sort the problem is that some of the numbers matlab reads in as numbers not strings if they dont have hypens for example >>> 9301923334 is a number but 930-192-3334 is a string when import them I use xlsread like this.
[numbers,strings,raw] = xlsread('contacts.xls');
for i = 1:length(numbers)
newarray(i) = num2cell(numbers(i));
end
this gives me an array of numeric data and string data which is great but the numbers array always uses scientific notation in when i use num2cell so the phone number will show up like >> 9.301923334+09 i need some way to get this to be formatted like a phone number or at least in a cell with just the numbers Thanks for all your help!!!
2 commentaires
Stephen23
le 28 Mai 2017
Why not fix the problem at the source? Ensure that all cells with telephone numbers are formatted as text, and then you avoid this whole problem.
Walter Roberson
le 28 Mai 2017
See https://www.mathworks.com/matlabcentral/answers/342248-how-do-i-keep-my-format-when-exporting-to-csv-or-excel#answer_268722 for more information on formatting them as strings
Réponses (1)
Voir également
Catégories
En savoir plus sur Standard File Formats dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!