velfreq.m
#1
velfreq.m
% velocityfrequency.m - histogram generating program
%=================================================
% bin_centers -- vector containing centers of bins
% frequency -- vector giving fractional number of
% measurements in each bin.
% m -- number of bins in histogram
% n -- number of measurements in each bin
% num_meas -- number of measurements
% vnew -- vector of pressure measurments
%=================================================
% Clear screen
clc
% Find the minimum and maximum, use first two cells as place holders.
vnew = zeros(1,92);
y = max(Vdisplay);
x = min(Vdisplay);
vnew(1) = x;
vnew(2) = y;
% number of histogram bins.
m = 50;
n = zeros(1,50);
Q = 'a';
% Output bar graph.
for i=3:92;
vnew(i)=Vdisplay(i);
[n, bins] = hist (vnew, m);
frequency = n/0.9;
if i==3;
n(1)=0;
end
% Output bar graph
figure(i)
bar (bins,frequency)
xlabel ('RBC Velocity (um/s)'),...
ylabel ('Frequency (%)'),...
title('RBC Velocity Measurement Frequency Distribution');
% Saving image to 'results' folder.
axis([0 600 0 15])
P = num2str(i);
root = 'C:\MATLAB6p1\work\Lawrence\results\';
filename = strcat(root,'frequencyhistogram',P);
saveas(i,filename,'jpg');
vnew
n
i
input( '\n ************************************************** ********************************' );
end
%=================================================
% bin_centers -- vector containing centers of bins
% frequency -- vector giving fractional number of
% measurements in each bin.
% m -- number of bins in histogram
% n -- number of measurements in each bin
% num_meas -- number of measurements
% vnew -- vector of pressure measurments
%=================================================
% Clear screen
clc
% Find the minimum and maximum, use first two cells as place holders.
vnew = zeros(1,92);
y = max(Vdisplay);
x = min(Vdisplay);
vnew(1) = x;
vnew(2) = y;
% number of histogram bins.
m = 50;
n = zeros(1,50);
Q = 'a';
% Output bar graph.
for i=3:92;
vnew(i)=Vdisplay(i);
[n, bins] = hist (vnew, m);
frequency = n/0.9;
if i==3;
n(1)=0;
end
% Output bar graph
figure(i)
bar (bins,frequency)
xlabel ('RBC Velocity (um/s)'),...
ylabel ('Frequency (%)'),...
title('RBC Velocity Measurement Frequency Distribution');
% Saving image to 'results' folder.
axis([0 600 0 15])
P = num2str(i);
root = 'C:\MATLAB6p1\work\Lawrence\results\';
filename = strcat(root,'frequencyhistogram',P);
saveas(i,filename,'jpg');
vnew
n
i
input( '\n ************************************************** ********************************' );
end