Info

此问题已关闭。 请重新打开它进行编辑或回答。

Formatting Array column in fprintf

1 次查看(过去 30 天)
Trang Hu Jia
Trang Hu Jia 2020-10-27
关闭: Stephen23 2020-10-27
Hello everyone,
I have using the command of fprintf to create data .dat file as
1 0.000000 0.000000 0.000000
2 0.000000 0.000000 4.000000
3 0.000000 0.000000 1.000000
4 0.000000 0.000000 2.000000
5 0.000000 11.000000 4.000000
6 0.000000 12.000000 4.000000
7 0.000000 13.000000 4.000000
8 0.000000 14.000000 4.000000
9 0.000000 15.000000 4.000000
10 10.000000 16.000000 4.000000
11 10.000000 17.000000 4.000000
12 0.000000 18.000000 4.000000
13 0.000000 12.000000 0.000000
14 0.000000 11.000000 0.000000
15 0.000000 10.000000 0.000000 etc.
Now i want to re-arrange to the same format as
1 0.0000000 0.0000000 0.0000000
2 0.0000000 0.0000000 4.0000000
3 0.0000000 0.0000000 1.0000000
4 0.0000000 0.0000000 2.0000000
5 0.0000000 11.000000 4.0000000
6 0.0000000 12.000000 4.0000000
7 0.0000000 13.000000 4.0000000
8 0.0000000 14.000000 4.0000000
9 0.0000000 15.000000 4.0000000
10 10.000000 16.000000 4.0000000
11 10.000000 17.000000 4.0000000
12 0.0000000 18.000000 4.0000000
13 0.0000000 12.000000 0.0000000
14 0.0000000 11.000000 0.0000000
15 0.0000000 10.000000 0.0000000 etc.

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by