MATLAB: How to measure mean of every 10 data of a vector size 1×1500 averageMATLABvector I have a vector of size 1×1500, whose every 10 values, are of one person (i.e, there are 150 persons). I should estimate the mean of those 10 values for each person. my script is not working well, any idea? Best Answer A = rand(1,1500); % your dataM = zeros(1,150); % MEAN MATRIXfor k=1:150 M(k) = mean(A(((k-1)*10+k):10*k));end Related SolutionsMATLAB: Iteration based on a specified number of digits for k=1:150 s=fix(log10(k)) % or s=numel(num2str(k))-1 a=sprintf('000%d',k) a(1:s)=[] out{k}=a;endout MATLAB: For loop not working We o not have your entire code. Note that the transpose call is not necessary, since the mean funciton also accepts a dimension argument, where 1 is down the rows for each column (the default) and 2 is across columns, taking the mean of each row. Related QuestionI want to create an average 2d field every 10 timesteps within a 3d matrix (6000 x 100 x100) –> (600 x 100 x100)Plotting array elements in different colorsArray Indexing using logicals in higher dimensionsConfusion regarding plot of Linear convolution vs high speed convolution
Best Answer