I am new to mathematica. Could you pls help me on how to write this:
I have a $5\times 10$ matrix, for example,
ap = ConstantArray[0.001, {5, 10}]
I have the second matrix $1\times 10$, for example,
b = {0.001,0.005,0.009,0.01,0.03,0.05,0.082,0.1,0.5,1}
I have a nested list z = {{1,3},{2,2},{5,7}}
for position.
I would like to have this result: In first matrix ap, for each row, for example row 1, if the element position is equal or larger than the second element in list Z in case the row number matches the first element (for example here it is 3), for every element in row 1 and after position 3 (include position 3), I would like to substitute elements in ap with elements from b, here would be substitute with {0.009,0.01,0.03,0.05,0.082,0.1,0.5,1}
Similarly for row 2 in matrix ap, I would like to substitute with elements in b starting position 2. So the final matrix is:
0.001,0.001,0.009,0.01,0.03,0.05,0.082,0.1,0.5,1
0.001,0.005,0.009,0.01,0.03,0.05,0.082,0.1,0.5,1
0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
0.001,0.001,0.001,0.001,0.001,0.001,0.082,0.1,0.5,1
Thank you very much!