COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Noise, histogram fitting, and residuals

• Follow

```A write up that follows the lab outline;
A detailed Matlab plot showing 1 fit to the noise:
A detailed Matlab plot of the mean and standard deviation for 100 iterations:
A detailed Matlab plot of the residual metric you obtain for 100 iterations:
A required functions in separate m-files must be develop:

I made a histogram fit random number of variable in an array of 512X512 and at count of 100 iterations: I need help on the plotting of the residual and a required functions in separate m-files must be develop. Can any one help me?Here is my program. thank you.

clear all;

% random variable for the histogram
sigma = 2;      % standard deviation of the random variable noise
offset = 8;     % The aritmetic data unit mean of the CCD
CCD_Dim = 512;  % The size of the Matrices in the array
N = 100;        % The number of iterations

% Gaussian distribution variable
A = 9900;        % The amplitude of the Gaussian equation
Xo=offset;

% Operational loop
for count = 1:N % The counter of the historgram

% Generate the random variables for the frames of CCD
noise = offset + sigma*randn(CCD_Dim);

X = linspace(-5,25,100);

% equation of gaussian
Y = A*exp((-(X-Xo).^2)/2/sigma.^2)

%(:) makes the graph smooth
myMean(count)= mean(noise(:));
mySTD(count) = STD(noise(:));

end

% Get the information for the histogram
figure(1); hist(noise(:), 100);

hold on; % holds the current plot
plot(X,Y,'r')

title('The Gaussian fit of the random variable');
ylabel('Amplitude');
xlabel('N');

hold off; % reset all properties of the old plot before a new plots.

figure(2);plot(myMean)
axis([0 100 7.9 8.1])
figure(2); title('hi');
figure(3);plot(mySTD)
```
 0

```On Mar 2, 11:52=A0am, "Paul Gonzales" <palitos...@gmail.com> wrote:
> A write up that follows the lab outline;
> A detailed Matlab plot showing 1 fit to the noise:
> A detailed Matlab plot of the mean and standard deviation for 100 iterati=
ons:
> A detailed Matlab plot of the residual metric you obtain for 100 iteratio=
ns:
> A required functions in separate m-files must be develop:
>
> I made a histogram fit random number of variable in an array of 512X512 a=
nd at count of 100 iterations: I need help on the plotting of the residual =
and a required functions in separate m-files must be develop. Can any one h=
elp me?Here is my program. thank you.
>
[code snipped]
---------------------------------------------------------------
Just make an array with the residuals and plot it.  You showed you
already know how to make up an array (your myMean and mySTD), and you
know how to call the plot() function, so just follow the same
procedure.
```
 0

1 Replies
347 Views

Similiar Articles:

7/22/2012 5:53:14 AM