presentation1d 2015 revision 1 print

Upload: ty-smith

Post on 01-Mar-2016

219 views

Category:

Documents


0 download

DESCRIPTION

Lecture notes of EN 525 427. The notes talk about matlab and how to configure it to run matlab code properly

TRANSCRIPT

  • Module 1D

    Simulink Sources and Sinks

    Simulink is a time domain simulator MATLAB is numerical engine for Simulink Easy to communicate between Simulink & MATLAB

    Import signals to Simulink from MATLAB workspace Export signals from Simulink to MATLAB workspace

    Signals easy to combine and observe in Simulink

    Dr. M. Lee EdwardsDr. Clinton L. Edwards

  • Module 1D 2

    Adding an additional source and sink (scope)

    2*pi*2e3

  • Module 1D 3

    Discrete Sine Wave and an Analog Sine Wave

  • Module 1D 4

    Post Simulation Processing

    2*pi*2e3 2 KHz

  • Module 1D 5

    Simulation configuration Parameters

  • Module 1D 6

    Run (Simulate) the Model

  • Module 1D 7

    MATLA

    B Com

    mand

    Wind

    ow

    >> whoYour variables are:Ts Fs tout yout yout1

    >> yout =time: [201x1 double]signals: [1x1 struct]blockName: 'Sim_Test2/To Workspace1'

    >> yout.signals=ans =values: [201x1 double]dimensions: 1label: ''

    >> close all>> figure(1)>> subplot(2,1,1), plot(yout.time, yout.signals.values)>> hold on>> subplot(2,1,1),stem(yout1.time, yout1.signals.values)>> subplot(2,1,2), plot(yout.time, yout.signals.values)>> hold on>> subplot(2,1,2),plot(yout1.time, yout1.signals.values, 'bo')>> subplot(2,1,2),stairs(yout1.time, yout1.signals.values,'r')

  • Module 1D 8

    Plots created from Matlab Command windowusing output from Simulink simulation

  • Module 1D 9

    Scope displays showing analog and discrete signals

  • Module 1D 10

    Plot Commands entered in StopFcn Callback

    StopFcn commandsexecuted aftersimulation stops