MATLAB: Mean of some element in Array mean value Hi! I have a array of size 8501*1. iwa nt to have the mean value of each 10 element. Afte each 10 elebent make a mean value. How to do this in matlab withot for-loop Thanks Best Answer A=rand(8501,1); %your dataB=mean(reshape(A(1:8500),10,[]))with the for loopii=1;A=rand(8501,1)for k=1:10:8501-10out(ii)=mean(A(k:k+9));ii=ii+1end Related SolutionsMATLAB: Trouble using dsolve function z = a*x+b*x^2+c+........; eqn = subs(sym('D2y +5*z+ 2*x + 10*z^2'), z, z);S = dsolve(eqn, x);Myself, I would probably toss in a simplify() around the subs() . MATLAB: How to collect non-integers from for loop in one matrix ii=0;for k=1:.5:10ii=ii+1 y(ii)=kendork=1:.5:10for ii=1:numel(k) y(ii)=k(ii)end Related QuestionHow to store values as arraySelect rows and put into cell arrayIt follows the END that terminates the definition of the function “NumIntF” errorMean of matrix elementsHow to solve this odd/even loop question (hailstone sequence)
Best Answer