Create a row vector, 1xN (Integer, >1), such that
the mean of the vector is M (Real number) and the standard deviation of the vector is S (Real number)
%example
N=2;
M=0;
S=sqrt(8);
y=[2 -2]
%or
y=[-2 2]
There is no unique answer, and the answer will be checked against the mentioned conditions.
The expected precision of Mean and STD is 6 digits after decimal.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers8
Suggested Problems
-
Set the array elements whose value is 13 to 0
1435 Solvers
-
How many monitors are connected ?
157 Solvers
-
468 Solvers
-
1252 Solvers
-
Find and replaces spaces from a input string with *
171 Solvers
More from this Author44
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
D'oh. For the longest time, I read
> Create a row vector, 1xN (Integer, >1) [...]
as requiring that the elements of the vector should be integers, and thought that this is a problem requiring more time and thought. It was only when I looked at the test suite now that I realized that that couldn't be the case since M*N was not an integer in several tests.