Hi, this is my code. For each m, I am generating a random data set with 23 elements, then sum up the elements and add the sum to the array t1_0. However the resulting array has just the last added sum, all the other values are zeros. I cannot figure out what I am doing wrong. Many thanks for help.
clc; clear all;
A = 1.1; mn = 0; sd = 1; N = 23;
m = 3;
t1_0 = zeros(m,1)
x0 = randn(N,1)*sd + mn;
t1_0(m) = sum(x0);
This is the output I get when I print out the values of sums for each m (m=3) and the final array: