Test Forum B5 FAQ

velfreq.m

Thread Tools
 
Search this Thread
 
Old 07-23-2002, 02:24 PM
  #1  
Elder Member
Thread Starter
 
SuspendedLikeaMoFo.'s Avatar
 
Join Date: Mar 2000
Posts: 12,893
Likes: 0
Received 0 Likes on 0 Posts
Default 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



All times are GMT -8. The time now is 05:38 AM.