使用 bash 脚本。示例文本文件是:
<Mixture> 1 1.0000
<Mean> 39
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
<Variance> 39
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
<TransP> 3
现在我想用其他一些作为matlab变量的数组替换零序列。即我希望它如下
<Mixture> 1 1.0000
<Mean> 39
-3.928404e+00 -2.833521e+00 1.418979e+00 -8.560805e+00 -4.987627e+00 -5.422057e+00 -2.148949e+00 -4.035418e+00 1.111476e+00 -4.360466e+00 -2.430894e+00 -3.562756e+00 2.149250e+01 4.148085e-03 3.280356e-01 1.993892e-01 4.226578e-01 3.070029e-01 3.061973e-01 2.200327e-01 2.279716e-01 1.851751e-01 2.630977e-01 2.530313e-01 1.584220e-01 -7.420680e-02 -6.129631e-02 6.845896e-03 1.414505e-02 5.905741e-02 7.828339e-02 6.020883e-02 7.195320e-02 4.838301e-02 4.507983e-02 6.380487e-02 7.884157e-02 6.597416e-02 -1.690722e-02
<Variance> 39
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
<TransP> 3