I wrote a function and a top level script that queries and will return n random numbers that are normally distributed with mean m and standard deviation s.
Here is my function and top level script:
Function:
function[gaussian]=my_gaussian(m,s,n);
gaussian=randn(1,n.*s)+m
Top Level Script:
m=input('Enter the mean of your gaussian random numbers:');
s=input('Enter the standard deviation of your gaussian random numbers:');
n=input('Enter the number of gaussian random numbers:');
[gaussian]=my_gaussian(m,s,n);
Yet when I test the top level script with this:
m=5
s=2
n=500
this program then spits out 1000 numbers instead of 500. Why?
Thanks,
Kim