Read Multiple Entries from Text File
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Mathieu NOE
am 16 Mär. 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 Kommentare
Jey Ganasan
am 16 Mär. 2021
Mathieu NOE
am 16 Mär. 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
am 16 Mär. 2021
Kategorien
Mehr zu Workspace Variables and MAT Files 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!