what str2num will perform?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
fid = fopen(txtfile,'r');
tline = fgetl(fid);
index = findstr(tline,'.');
i = i+1;
filenames(i) = str2num(tline(1:index-1))+1;
what is the function of str2num here? I am not getting clear with the mathwork help. Can anyone explain in brief?
2 commentaires
Rik
le 13 Nov 2018
As the documentation mentions, str2num uses eval and might thus have unintended side effects, which you can avoid by using str2double. In most cases these two functions should be equivalent.
Réponses (0)
Voir également
Catégories
En savoir plus sur Data Type Conversion 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!