1234567891011121314151617 |
- function sem=sem(data,stdWeight)
- % calculate standard error of the mean in the 1st dim
- % stdWeight==0: N-1
- % stdWeight==1: N
- if iscell(data)
- if size(data,2)>size(data,1)
- data=data';
- end
- for i=1:length(data)
- sem(i,1)=std(data{i,1},stdWeight,1)/sqrt(size(data{i,1},1));
- end
- else
- sem=std(data,stdWeight,1)/sqrt(size(data,1));
- end
- end
|