from SimDriver V1.0 by Gin ULYSSES
Simulation driver for parametrized simulation M-files

sincos.m
% This section is free : put anyhting you want here

% PARAMETERS BEGIN
gain = 1.0 ;             % This section must exist and be delimited as shown
freq = 10.0 ;            % It must be made only of single real definitions
damp = 0.1 ;             % No other statement is allowed (matrix def., condition, etc ...)
% PARAMETERS END

% This section is free : put anyhting you want here

% Example : simple algebraic computations
time   = [ 0 : 1/freq/50 : 1/freq*10 ]' ;
result = [ gain * cos( 2 * pi * freq * time ) .* exp( - damp * pi * freq * time ) ...
         , gain * sin( 2 * pi * freq * time ) .* exp( - damp * pi * freq * time ) ] ;

% This section is free : put anyhting you want here

% RESULTS BEGIN
time   = time ;          % This section must exist and be delimited as shown
my_cos = result(:,1) ;   % It must be made only of real vector definitions (all equal length)
my_sin = result(:,2) ;   % with first reference vector name equal to "time" or "frequency"
% RESULTS END

% This section is free : put anyhting you want here

Contact us at files@mathworks.com