Download - S&S Labreport 01
-
8/17/2019 S&S Labreport 01
1/14
FOUNDATION UNIVERSITY RAWALPINDICAMPUS
ELECTRICAL ENGINEERING DEPARTMENT
SIGNALS AND SYSTEMS (LAB)
LAB REPORT # 1
BASIC MATLAB COMMANDS
NAME: SHAH ZEB
REG # 067
SECTION: BSEE!B
DATE: 1"1001"
SUBMITTED TO: E$%& A'$$ *$
-
8/17/2019 S&S Labreport 01
2/14
INTRODUCTION:
MATLAB stands for MATRIX LABORATORY. MATLAB is a high-performancelanguage for technical computing. It integrates computation, isuali!ation, andprogramming enironment. MATLAB is a modern programming language enironment"
it has sophisticated data structures, contains #uilt-in editing and de#ugging tools, andsupports o#$ect-oriented programming. These factors ma%e MATLAB an e&cellent toolfor teaching and research.
MATLAB is an interactive system whose basic data element is an arraythat does not require dimensioning.
It has powerful built-in routines that enable a very wide variety of computations. ItAlso has easy to use graphics commands that mae the visuali!ation of results immediately available. "peci#c applications are collected in pacagesreferred to as toolbo$. There are toolbo$es for signal processing% symboliccomputation% control theory% simulation% optimi!ation% and several other
#elds of applied science and engineering.
MATLAB BASICS: A. '()I*ITIO* O) +ARIABL("
. a / 0
Yields" a 1
-
8/17/2019 S&S Labreport 01
3/14
0. # 0 2 a3
Yields" # 4
1. 5 0 2 6 / 7 2 $8
Yields" 0.9999 / :.9999i
-
8/17/2019 S&S Labreport 01
4/14
7. 5 0 2 6 / 7 2 $8c a#s658Yields" c :.0740d angle658Yields" c .10;:
;. a 13c cos 6a8Yields" -9.
-
8/17/2019 S&S Labreport 01
5/14
Yields" 09.9:;;
B. '()I*ITIO* O) MATRI=(". > 1 ; ?@
0. > 1 ; ?@36;8 :
-
8/17/2019 S&S Labreport 01
6/14
1. > 1 ; ?@3a >< 9@3# > a@Yields" # > 1 ; ? < 9@
-
8/17/2019 S&S Labreport 01
7/14
7. M > 0 731 4 :@
Yields" M 1 2 4
3 6 8
;. a > 0 1@3# >7 ; 4@3c a / #
Yields" c 5 7 9
-
8/17/2019 S&S Labreport 01
8/14
4. t 9"93& cos 602t8Yields" & .9999 -9.74 -9.4;14 9.
-
8/17/2019 S&S Labreport 01
9/14
. & -"9.9"03plot6&,&.C08&la#el6Dtime6sec8D85la#el6Delocit5D8title6D+elocit5-Time raphD8
0. & 9"9."93plot6&,cos6&88title6Dcosine graphD8&la#el6D&D85la#el6Dcos6&8D8
1. & 9"9."93
-
8/17/2019 S&S Labreport 01
10/14
plot6&,sin6&88title6Dsine graphD8&la#el6D&D85la#el6Dsin6&8D8
7. Multiple =ures and Te&t& 9"9."93plot6&,sin6&88hold onplot6&,cos6&88
hold off title6Dsine and cosine graphD8&la#el6D&D85la#el6Dsin6&8Ecos6&8D8te&t61,9.0,D5sin6&8D8te&t6;,9.0,D5cos6&8D8grid
-
8/17/2019 S&S Labreport 01
11/14
;. & 9"9."93su#plot 60,,8,plot6&,sin6&88title6Dsine graphD8&la#el6D&D8
5la#el6Dsin6&8D8gridsu#plot60,,08,plot6&,cos6&88title6Dcosine graphD8&la#el6D&D85la#el6Dcos6&8D8grid
-
8/17/2019 S&S Labreport 01
12/14
4. t 9 " 9.9 "93f 6Dinput freFuenc5D83& e&p602t8plot6t ,&8
-
8/17/2019 S&S Labreport 01
13/14
?. & 9"9."93su#plot 61,,8,plot6&,sin6&88title6Dsine graphD8&la#el6D&D8
-
8/17/2019 S&S Labreport 01
14/14
5la#el6Dsin6&8D8gridsu#plot61,,08,plot6&,cos6&88title6Dcosine graphD8&la#el6D&D8
5la#el6Dcos6&8D8gridsu#plot61,,18,plot6&,e&p602&88title6De&ponential graphD8&la#el6D&D85la#el6De&p602&8D8grid on