Read value from a text file and store into an array
显示 更早的评论
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!