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

save_config(cfg_struct, fname)
function save_config(cfg_struct, fname)
% SAVE_CONFIG - save configuration.
%
% Call:   save_config(cfg_struct, fname)
%
% Parameters:
%             cfg_struct - structure with freeway configuration;
%             fname      - name of file where configuration must be saved.
%
% Returns:   none.
%
% Last modified:   11/17/2006.

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

if isfield(cfg_struct, 'configFile') & ~isempty(cfg_struct.configFile)
  load(cfg_struct.configFile);
end

celldata    = cfg_struct.cellData;
defaultCell = cfg_struct.defaultCell;
freeway     = cfg_struct.freeway;
configFile  = fname;

clear cfg_struct fname;

if str2num(version('-release')) >= 14
  feval(@save, '-v6', configFile);
else
  feval(@save, configFile);
end

return;

Contact us at files@mathworks.com