Using for loops in order to find average of matrix
조회 수: 13(최근 30일)
Hi I have a 1000x100000 matrix.
I'd like to know the average of the numbers in each column, so that's 100000 values I'm looking for.
I can use the mean() command, and I'm trying to get this done using for loop and preallocation. What i have atm:
mu = 2;
SD = 3;
m = 1000;
n = 100000;
random_matrix = randn(m,n)*SD + mu;
a(k,h) = means(random_matrix(k,h));
I dont know whats wrong arrgh. Can someone help me? I think i am not wrong at all, but my program does not stop running...
Thanks in advance!