Suppose I have the following code
b = 1:3
m = 5
for(j in 1:2){
for(i in 1:5){
print((1-i/m)* b[j] + (i/m)* b[j+1])
}
}
If i print this i get the following output
[1] 1.2
[1] 1.4
[1] 1.6
[1] 1.8
[1] 2
[1] 2.2
[1] 2.4
[1] 2.6
[1] 2.8
[1] 3
However, now I would like to store this data into a single column vector. When i substitute print for an empty vector or list z[i] <- this ofcourse does not work. Does anyone know how to get the for loop value into a single column vector?