How to get rid of two consecutive double quotes from my string?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have pasted some data from R into one of my Matlab variable. Here, I have a string enclosed with two double quotes e.g ""0110001010001001001011"". Due to these two quotes the length of the string is showing as 1. My objective is to place each bit of the string as an array element. And then convert it into numeric. Directly applying str2num on the exaple gives the result as 1.1000e+20 which does not serve my purpose.
0 Commenti
Risposte (1)
Mohammad Sami
il 11 Set 2020
if true
% remove double quotes
somestr = regexprep(somestr,'"','');
Numarray = char(somestr) - '0';
end
Vedere anche
Categorie
Scopri di più su Data Type Conversion in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!