

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


ECE-314 Spring 2006 Signal and Systems (Matlab Tutorial) MATLAB (short for MAT rix LAB oratory)
clear all; %clean the workspace close all; %close all opened figures clc; %clean the command window time=[0 .5 1 1.5 2]; temp=[105 126 119 129 132]; figure, plot(time,temp) figure, plot(time,temp,''),grid figure, plot(time,temp,'-'),grid xlabel('time (s)') ylabel('temperature') Plot the function y=sin(2t) in matlab, with x-abscise labeled “Time(s)” and the y-abscise “y(t)”; use t between 0 and 15 seconds. clear all; %clean the workspace close all; %close all opened figures clc; %clean the command window t=0: y=sin(2*t) figure, plot(t,y),grid %figure, plot(t,y),grid xlabel('time (s)') ylabel('y(t)')
Find y(n), for n=1,…,. y(n) is given by: y(n)=20+y(n-1) ; y(1)= Compute their sum clear all; close all; clc; y(1)=2; for n=2: y(n)=20+y(n-1); end y sum(y)
help stem STEM Discrete sequence or "stem" plot. STEM(Y) plots the data sequence Y as stems from the x axis terminated with circles for the data value. STEM(X,Y) plots the data sequence Y at the values specified in X. STEM(...,'filled') produces a stem plot with filled markers. STEM(...,'LINESPEC') uses the linetype specifed for the stems and markers. See PLOT for possibilities. H = STEM(...) returns a vector of line handles. See also PLOT, BAR, STAIRS.