Read value from a text file and store into an array
Mostrar comentarios más antiguos
I have a text file 'Busdata8.txt' which has data as follows:
%|Bus | Type | Vsp | theta | PGi | QGi | PLi | QLi | Qmin | Qmax | Transaction |
1 1 1.0 0 0 0 0 0 0 0 1
2 2 1.03 0 550 0 0 0 0 0 1
3 3 1.0 0 0 0 350 0 0 0 1
4 3 1.0 0 0 0 300 0 0 0 1
5 3 1.0 0 0 0 250 0 0 0 1
6 3 1.0 0 0 0 100 0 0 0 2
7 3 1.0 0 0 0 100 0 0 0 3
8 2 1.05 0 100 0 0 0 0 0 2
8 2 1.05 0 100 0 0 0 0 0 3
I want to skip the wordings in the first line and extract the numerical data into an array, something look like this:
Array = 1 1 1.0 0 0 0 0 0 0 0 1
2 2 1.03 0 550 0 0 0 0 0 1
3 3 1.0 0 0 350 0 0 0 0 1
4 3 1.0 0 0 300 0 0 0 0 1
5 3 1.0 0 0 250 0 0 0 0 1
6 3 1.0 0 0 100 0 0 0 0 2
7 3 1.0 0 0 100 0 0 0 0 3
8 2 1.05 0 100 0 0 0 0 0 2
8 2 1.05 0 100 0 0 0 0 0 3
Kindly help me out. Thanks in advance.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Whos en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!