Code covered by the BSD License  

Highlights from
CTMSIM - an interactive freeway traffic macrosimulator

image thumbnail
from CTMSIM - an interactive freeway traffic macrosimulator by Alex Kurzhanskiy
Freeway traffic simulation based on Asymmetric Cell Transmission Model

get_critical_densities(celldata)
function dc = get_critical_densities(celldata)
% GET_CRITICAL_DENSITIES - extract critical density values from the array
%                          of freeway cell data structures.
%
% Call:   dc = get_critical_densities(celldata)
%
% Parameter:   celldata - array of freeway cell data structures.
%
% Returns:   dc - vector of critical densities.
%
% Last modified:   07/30/2006.

%
% Alex Kurzhanskiy   <akurzhan@eecs.berkeley.edu>
%

N  = size(celldata, 2);  % number of cells

dc = [];

for i = 1:N
  dc = [dc; celldata(i).FDrhocrit];
end

return;

Contact us at files@mathworks.com