arrays - Can You assign a value A to a value B given two sets of data in matlab? -
i new matlab , have following problem: have 2 arrays lot of integers, , able assign given data point 1 array another. example:
array1 = [1, 2, 3] array2 = [2, 4, 6]
so if have data array1, in case, able array1*2 = array2
. there different ways solve this, , have 2 arrays 100k elements each. need divide data smaller segments , create average each, may able derive array1*x ~ array2. need estimation, example above doesnt justice. help
from understand want estimate x in formula: array1*x = array2
if devide estimate each value, take mean have estimator of x
mean(double(array2)./double(array1))
you worry 100k values, 200k values in total. not big matlab. concider each value takes 8 bytes. 1600kb not computer.
you fit simple linear regression model
sum(array1.*array2) / sum(array1.^2)
Comments
Post a Comment