how n(20*20 matrix) can obtain

mean(s./n)=0.5
s= 1 2 3 4 5 ...20
20 19 18 17 16....1
1 2 3 4 5 ...20
20 19 18 17 16....1
1 2 3 4 5 ...20
20 19 18 17 16....1
...................
...................
20 19 18 17 16....1
s is a 20*20 matrix and it is fix; how n(20*20 matrix) can obtain such it follow above equation.

2 commentaires

Image Analyst
Image Analyst le 28 Déc 2012
You're posting enough now that you should learn how to highlight your code and click the {}Code button to format your code. Make sure there is a blank line before the first line of code though.
Image Analyst
Image Analyst le 28 Déc 2012
You don't click {}Code first. If you do that, you get that useless "if true" like you just did. Just do what I said: make sure there's a blank line before your code, then highlight all your code (even intermediate blank lines if it's a long bit of code), then click {}Code.

Connectez-vous pour commenter.

 Réponse acceptée

Image Analyst
Image Analyst le 28 Déc 2012

0 votes

It's trivial. Just solve the equation for n! You'll find it's twice s. Here's proof:
% Construct s.
s2rows = [1:20;20:-1:1];
s = repmat(s2rows, [10,1])
% Here's n. It's just twice s!
n = s /0.5
% Proof that the mean = 0.5
theMean = mean2(s ./ n)

5 commentaires

vipul utsav
vipul utsav le 28 Déc 2012
here i needs s is fix,in your code s is change
vipul utsav
vipul utsav le 28 Déc 2012
i have s and i defined it in post, i do not require construct it, only i require n of 20*20 matrix.
Jan
Jan le 28 Déc 2012
@Vipul: No, "s" has exactly the same fixed matrix as in your question. Why do you think, that "s" is changed?
Btw, accepting an answer means, that it has solved your problem. Therefore the number of readers will be much smaller than for a thread without an accepted answer.
Image Analyst
Image Analyst le 28 Déc 2012
And it doesn't matter WHAT s is. It could be anything at all. Just look at the equation - it's really basic math. No matter what s is, s over (2s) will be 1/2 for every single element, and thus give you a mean of 0.5. Is there something either I or you are not understanding here?
vipul utsav
vipul utsav le 29 Déc 2012
i am really sorry, i did mistake,i misunderstand,,, it's 100% right answer

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by