Hello everyone,
I want to say that this thread is not a homework. I need a csh or sh script to perturbate a 3D earthquke wave velocity model I developed so I just want to learn how to multiply each node in one file with the same nodes in the other file and write it to another file. the example below is just random number.
The real sizes of my matrix is 35*233.
I have two matrices at same sizes. I need to re-calculate the numbers in matrix A according to the percentages in martix B
it is like
matrix A is
10.00 20.00 30.00 40.00
60.00 70.00 80.00 90.00
20.00 30.00 80.00 50.00
martix B is
00.08 00.05 00.06 00.07
00.05 00.06 00.08 00.06
00.02 00.01 00.09 00.07
Matrix C should be calculated like
10+(10*0.08) 20+(20*0.05) 30+(30+0.06) 40+(40+0.07)
60+(60*0.05) 70+(70*0.06) 80+(80*0.08) 90+ (90*0.06)
20+(20*0.02) 30+(30*0.01) 80+(80*0.09) 50+(50*0.07)
and the result should look like
10.80 21.00 31.80 42.80
63.00 74.20 86.40 95.40
20.04 30.30 87.20 53.50
There are no number larger then 99. there is 2 digit before and after the dots. and 2 spaces between the numbers