Two outputs when calculating standard error of mean, WHY?
3 visualizzazioni (ultimi 30 giorni)
I am calculating the standard error of the mean and I am getting two ouput. I do not understand why. The code is:
SEM_A = std(A,)./ sqrt(size(A))
And my output is:
Do You have any ideas?
Daniel M il 7 Nov 2019
Modificato: Daniel M il 7 Nov 2019
It's because size(A) returns two outputs. If you want to use the size of A in a particular dimension, use size(A,dim). (Since size operates columnwise, it's likely only dim=2 would make sense). If you want to divide by the total number of elements in A, use numel(A). If A is a vector then numel(A) is the same as length(A), which is the same as max(size(A)).