我想计算每个元素的均方平方l
l=[0.02817088, -0.74100320, -0.54062120, -0.24612808, 0.06945337, -0.58415690, -0.51238549,
-0.07862326, -0.42417337, -0.33482340, -0.21339753, -0.03890844, -0.59325371, 0.28154593,
-0.32133359,-0.13534792, 0.14060645, 0.32204972, 0.44438052, -0.21750973,-0.59107599,
-0.60809913]'
k= -0.2224834
sum(l-k)^2/22
我不确定 j=1,2,...,22 的每个(l[j]-k)
的总和是否sum(l-k)^2/22
?
ANS = 2.4223e-14
我想你需要的可能是
>> mean((l-k).^2)
ans = 0.10945
数据(如果l
不同行中有数据,则需要...
行延续)
l=[0.02817088, -0.74100320, -0.54062120, -0.24612808, 0.06945337, -0.58415690, -0.51238549, ...
-0.07862326, -0.42417337, -0.33482340, -0.21339753, -0.03890844, -0.59325371, 0.28154593, ...
-0.32133359,-0.13534792, 0.14060645, 0.32204972, 0.44438052, -0.21750973,-0.59107599, ...
-0.60809913]'
k= -0.2224834