Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: matrix from random selected data
Replies: 2   Last Post: Nov 7, 2013 6:08 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 1,966
Registered: 12/6/04
Re: matrix from random selected data
Posted: Nov 7, 2013 3:38 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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((ii-1):(ii+1),(jj-1):(jj+1))

% might be what you want.
% Note: the above requires 1<ii,jj<100
% (can't be an edge).



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.