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_pm_data(celldata)
function pmarr = get_pm_data(celldata)
%
% GET_PM_DATA - returns the array of post miles extracted from the array of
%               freeway cell structures.
%
% Call:   pmarr = get_pm_data(celldata)
%
% Parameter:   celldata - array of freeway cell structures.
%
% Returns:   pmarr - array of post miles that define cell boundaries.
%
% Last modified:   07/30/2006.

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

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

pmarr = [];

for i = 1:N
  pmarr = [pmarr celldata(i).PMstart];
end

pmarr = [pmarr celldata(end).PMend];

return;

Contact us at files@mathworks.com