Read Multiple Entries from Text File
Afficher commentaires plus anciens
May i know how can i import multiple entries such as this:
32*0 0.237024 0.248206 39*0 0.217874 0.160635
0.193782 0.242259 0.281551 37*0 0.168798 0.178275
As for the first input, i want to create 32 separate inputs of zeros. Thank you.
Réponse acceptée
Plus de réponses (1)
Mathieu NOE
le 16 Mar 2021
hello
you can concatenate datas and vectors of zeros like that :
a = [zeros(1,32) 0.237024 0.248206 zeros(1,39) 0.217874 0.160635];
b = [0.193782 0.242259 0.281551 zeros(1,37) 0.168798 0.178275];
3 commentaires
Jey Ganasan
le 16 Mar 2021
Mathieu NOE
le 16 Mar 2021
ok
so you have a text file , and each line must be converted to a numerical vector , with , for example " 10*0 " converted into zeros (1,10) ? am I right ?
Jey Ganasan
le 16 Mar 2021
Catégories
En savoir plus sur Workspace Variables and MAT Files dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!