Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Curious
Posts:
2,141
Registered:
12/6/04


Re: matrix from random selected data
Posted:
Nov 7, 2013 3:38 PM


"dony" wrote in message <l5fded$qdf$1@newscl01ah.mathworks.com>... > hai, > I have some problem > and i need help > i have matrix in 100x100, and from this matrix i have some random selected data. > from this data, i want to make it(selected data) to be a center of 3x3 new matrix > and then from this new matrix i want to calculate mean and standart deviation. > thanks for help
% The last part should be simple % If A is your 3X3 "new" matrix, then
mean(A) % or mean(A(:)) % or some variation of that should give your mean value. % Use std in the same way to get the standard deviation
doc mean doc std
% Its not clear from your description how the "new" % matrix is derived from the original 100X100 matrix. % Can you provide an example?
% I'm guessing that if ii & jj are a location within % your 100X100 matrix (call it X) then perhaps:
A = X((ii1):(ii+1),(jj1):(jj+1))
% might be what you want. % Note: the above requires 1<ii,jj<100 % (can't be an edge).



