Using Matlab to Plot and analyze
Electronics Workbench data.
Matlab has considerable flexibility in plotting and analysing data, so we may
use it when EWB is too constraining. EWB has three ways of saving data in files:
- The oscilloscope (expanded) has a save button
which will record the traces as an array of times and one or two voltages
for each time.
- The Bode-plotter has a save button which will
record an array of frequencys with log(amplitude), amplitude, and phase for
each frequency.
- The "disk-write" module in the"
miscellaneous" menu will write an array of times with up to eight voltages
for each time.
Each of these file types has a simple, human-readable format, but matlab needs
a little conversion program to strip out some extra information that EWB inserts
in the file. The following three matlab programs handle the conversion and draw
simple plots.
- readbod.m reads the output of the Bode-plotter.
- readscp.m reads the output of the Oscilloscope.
- readdisk.m reads the output of the "Disk-write"
module.
There is also some test data for you to try out:
- The file notch.bod can be read with
readbod.m.
- The file notch.scp can be read with
readscp.m.
- The file notch.txt can be read with
readdisk.m.