tut01 - Adding Numbers
- Example tut01:
- adds incoming numbers
- model
- components
- am_vectorgen generates
given output values at given times
- am_add2 adds two
incoming numbers
- am_toworkspace stores
time and value of incoming events in a global output
variable
- Running the model:
- use run script runTut01.m
- can be used similarly for all models
- model generator
- translates Simulink model into Matlab files
- one file for top-level model
- files for additional coupled models, if
necessary
- model simulator
- runs the model for the simulation time
- cleans up intermediate files
- returns all outputs in the variable out
- plotResults01 displays the
results
- uses standard Matlab plot commands
- Plotting the results:
- simple
example plotResults01.m
- output data in out
- structure with a field for
each am_toworkspace block
- block data is structure with
fields t
and y
- show events using stem plots
- result