Let say.. I have data like this
wij = [0.5, 0.30, 0.25, 0.15, 0.25]
and

As you see.. each data in wij is represent from C1 until C5 from table above
C1=0.5, C2=0.30, C3=0.25, C4=0.15, C5=0.25
So.. i create the wij into array-variable like this:
$wij = array(0.5, 0.30, 0.25, 0.15, 0.25);
and A1 until A5 rows into array-variable:
$nij = array(
array(150, 15, 2, 2, 3);
array(500, 200, 2, 3, 2);
array(200, 10, 3, 1, 3);
array(350, 100, 3, 1, 2);
);
I want to multiplying each data from wij with data from A1 until A5 rows, so it will be look like this:
A1 = (0.5*150)+(0.30*15)+(0.25*2)+(0.15*2)+(0.25*3)
A2 = (0.5*500)+(0.30*200)+(0.25*2)+(0.15*3)+(0.25*2)
A3 = (0.5*200)+(0.30*10)+(0.25*3)+(0.15*1)+(0.25*3)
A4 = (0.5*350)+(0.30*100)+(0.25*3)+(0.15*1)+(0.25*2)
I don't have any clue how to do it using for-loops or foreach-loops. Because each rows in table is not always have 4 data like from table above, it can always 5 rows or more, so I guess it will be work if using for-loops.