SlideShare a Scribd company logo
Signals and Systems Lab Course

Grading Criteria
Attendance……….10%
Lab Tasks…………..30%
Project………………20%
Lab exam..………...20%

Viva…………………..20%

CECOS College of Engineering and IT

March – July 2012
Accessing lab server
 To download manuals and software from lab server
 Goto : start >> Run >> write dsp-server

CECOS College of Engineering and IT

March – July 2012
Lab No.01

Getting Familiar with MATLAB

Designed by : Dawar Awan
dawar@cecos.edu.pk
CECOS College of Engineering and IT

March – July 2012
MATLAB
 Software by MathWorks
 Matrix Laboratory
 Every thing is treated as matrix
 Integrates computation, visualization, and programming
in an easy-to-use environment
 A high-level technical computing language and interactive
environment for algorithm development, data
visualization, data analysis, and numeric computation
CECOS College of Engineering and IT

March – July 2012
MATLAB
 add-on toolboxes provide application specific commands
 The power lye in rich libraries and toolboxes for almost
every field of engineering

CECOS College of Engineering and IT

March – July 2012
Starting/Ending MATLAB
 Double click MATLAB icon to launch MATLAB
 A command window will appear with the prompt
>>
you are now in MATLAB
 To quit from MATLAB write “exit” or “quit” on MATLAB
prompt and press enter

CECOS College of Engineering and IT

March – July 2012
MATLAB Interface

Current directory

Command window
Workspace

Command history

CECOS College of Engineering and IT

March – July 2012
Variables
 User defined variables




CECOS College of Engineering and IT

(“^” , is used for power)

March – July 2012
Variables
 Suppressing output

(use semi colon at the end of instruction)

 Value of variable

CECOS College of Engineering and IT

March – July 2012
Variables
 Knowing your active variables
>> who
Your variables are:
ans x y
 To remove a variable, write clear variablename

>> clear x
 To remove all the variables from workspace, use clear
>> clear

CECOS College of Engineering and IT

March – July 2012
Variable arithmetic

2+3*4^2 <== exponent has the highest precedence
==> 2 + 3*16 <== then multiplication operator
==> 2 + 48 <== then addition operator
==> 50

CECOS College of Engineering and IT

March – July 2012
Predefined trigonometric functions
Function
Meaning
Example
===========================================================
sin
sine
sin(pi) = 0.0
cos
cosine
cos(pi) = -1.0
tan
tangent
tan(pi/4) = 1.0
asin
arcsine
asin(1)= 1.5708
acos
arccosine
acos(1)= 0.0
atan
arctangent
atan(1)= 0.7854
exp
exponential
exp(1.0) = 2.7183
log
natural logarithm
log(2.7183) = 1.0
log10
logarithm base 10
log10(100.0) = 2.0
===========================================================
The arguments of trigonometric functions are given in radians

CECOS College of Engineering and IT

March – July 2012
Practice
 Verify that
sin2(x)+ cos2(x) = 1

 For arbitrary x, the MATLAB code will be:

CECOS College of Engineering and IT

March – July 2012
MATLAB Help
 www.mathworks.com
 >> help
 >> help <command name>

CECOS College of Engineering and IT

March – July 2012
Tasks
1. Write a MATLAB code to verify the formula
a2-b2 = (a+b)(a-b)

2. What is the function of the commands, ceil and floor ? Use
MATLAB help to learn these commands and then apply them
to a constant of 4.5
3. Use MATLAB to find the area of a circle whose radius is 4

CECOS College of Engineering and IT

March – July 2012

More Related Content

PDF
PDF
PDF
PDF
PDF
PDF
PDF
PPTX
source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques

What's hot (11)

DOC
Xi practical file
PPTX
Convolution using Scilab
PPTX
Linear regression model
PPT
Function overloading in c++
DOCX
Cis 355 i lab 3 of 6
PDF
Introduction to simulink (1)
PDF
Tte 451 operations research fall 2021 part 1
PPT
MATLAB/SIMULINK for engineering applications: day 3
PDF
R programmingmilano
PPT
Binary operator overloading
PPT
Profiling Java Programs for Parallelism
Xi practical file
Convolution using Scilab
Linear regression model
Function overloading in c++
Cis 355 i lab 3 of 6
Introduction to simulink (1)
Tte 451 operations research fall 2021 part 1
MATLAB/SIMULINK for engineering applications: day 3
R programmingmilano
Binary operator overloading
Profiling Java Programs for Parallelism
Ad

Viewers also liked (10)

PDF
PDF
PDF
PPT
communication system Chapter 6
PPT
communication system ch1
PDF
PPT
communication system Chapter 5
PPT
communication system Chapter 3
PPT
communication system Chapter 4
PPT
communication system Chapter 2
communication system Chapter 6
communication system ch1
communication system Chapter 5
communication system Chapter 3
communication system Chapter 4
communication system Chapter 2
Ad

Similar to matlab no1 (20)

PDF
++Matlab 14 sesiones
PPT
Introduction to Matlab
PPTX
Simulation lab
PDF
Matlab ch1 intro
PPTX
Matlab introduction
PDF
Digital Signal Processing Laboratory Manual
DOCX
Signals And Systems Lab Manual, R18 Batch
DOC
Digital Signal Processing Lab Manual
PDF
Matlab Introduction and Basics Guide.pdf
PDF
Programming with matlab session 1
PPTX
Mat lab workshop
PDF
sol43.pdf
PDF
Dsp manual completed2
PDF
Matlab lec1
PPTX
Lecture 1.pptx
PPT
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
PPTX
3_MATLAB Basics Introduction for Engineers .pptx
DOCX
KEVIN MERCHANT DOCUMENT
++Matlab 14 sesiones
Introduction to Matlab
Simulation lab
Matlab ch1 intro
Matlab introduction
Digital Signal Processing Laboratory Manual
Signals And Systems Lab Manual, R18 Batch
Digital Signal Processing Lab Manual
Matlab Introduction and Basics Guide.pdf
Programming with matlab session 1
Mat lab workshop
sol43.pdf
Dsp manual completed2
Matlab lec1
Lecture 1.pptx
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
3_MATLAB Basics Introduction for Engineers .pptx
KEVIN MERCHANT DOCUMENT

Recently uploaded (20)

PPTX
master seminar digital applications in india
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Classroom Observation Tools for Teachers
PDF
Updated Idioms and Phrasal Verbs in English subject
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
RMMM.pdf make it easy to upload and study
PDF
Computing-Curriculum for Schools in Ghana
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
master seminar digital applications in india
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Final Presentation General Medicine 03-08-2024.pptx
Classroom Observation Tools for Teachers
Updated Idioms and Phrasal Verbs in English subject
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
LDMMIA Reiki Yoga Finals Review Spring Summer
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
RMMM.pdf make it easy to upload and study
Computing-Curriculum for Schools in Ghana
Chinmaya Tiranga quiz Grand Finale.pdf
Weekly quiz Compilation Jan -July 25.pdf
Complications of Minimal Access Surgery at WLH
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
What if we spent less time fighting change, and more time building what’s rig...

matlab no1

  • 1. Signals and Systems Lab Course Grading Criteria Attendance……….10% Lab Tasks…………..30% Project………………20% Lab exam..………...20% Viva…………………..20% CECOS College of Engineering and IT March – July 2012
  • 2. Accessing lab server  To download manuals and software from lab server  Goto : start >> Run >> write dsp-server CECOS College of Engineering and IT March – July 2012
  • 3. Lab No.01 Getting Familiar with MATLAB Designed by : Dawar Awan dawar@cecos.edu.pk CECOS College of Engineering and IT March – July 2012
  • 4. MATLAB  Software by MathWorks  Matrix Laboratory  Every thing is treated as matrix  Integrates computation, visualization, and programming in an easy-to-use environment  A high-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numeric computation CECOS College of Engineering and IT March – July 2012
  • 5. MATLAB  add-on toolboxes provide application specific commands  The power lye in rich libraries and toolboxes for almost every field of engineering CECOS College of Engineering and IT March – July 2012
  • 6. Starting/Ending MATLAB  Double click MATLAB icon to launch MATLAB  A command window will appear with the prompt >> you are now in MATLAB  To quit from MATLAB write “exit” or “quit” on MATLAB prompt and press enter CECOS College of Engineering and IT March – July 2012
  • 7. MATLAB Interface Current directory Command window Workspace Command history CECOS College of Engineering and IT March – July 2012
  • 8. Variables  User defined variables   CECOS College of Engineering and IT (“^” , is used for power) March – July 2012
  • 9. Variables  Suppressing output (use semi colon at the end of instruction)  Value of variable CECOS College of Engineering and IT March – July 2012
  • 10. Variables  Knowing your active variables >> who Your variables are: ans x y  To remove a variable, write clear variablename >> clear x  To remove all the variables from workspace, use clear >> clear CECOS College of Engineering and IT March – July 2012
  • 11. Variable arithmetic 2+3*4^2 <== exponent has the highest precedence ==> 2 + 3*16 <== then multiplication operator ==> 2 + 48 <== then addition operator ==> 50 CECOS College of Engineering and IT March – July 2012
  • 12. Predefined trigonometric functions Function Meaning Example =========================================================== sin sine sin(pi) = 0.0 cos cosine cos(pi) = -1.0 tan tangent tan(pi/4) = 1.0 asin arcsine asin(1)= 1.5708 acos arccosine acos(1)= 0.0 atan arctangent atan(1)= 0.7854 exp exponential exp(1.0) = 2.7183 log natural logarithm log(2.7183) = 1.0 log10 logarithm base 10 log10(100.0) = 2.0 =========================================================== The arguments of trigonometric functions are given in radians CECOS College of Engineering and IT March – July 2012
  • 13. Practice  Verify that sin2(x)+ cos2(x) = 1  For arbitrary x, the MATLAB code will be: CECOS College of Engineering and IT March – July 2012
  • 14. MATLAB Help  www.mathworks.com  >> help  >> help <command name> CECOS College of Engineering and IT March – July 2012
  • 15. Tasks 1. Write a MATLAB code to verify the formula a2-b2 = (a+b)(a-b) 2. What is the function of the commands, ceil and floor ? Use MATLAB help to learn these commands and then apply them to a constant of 4.5 3. Use MATLAB to find the area of a circle whose radius is 4 CECOS College of Engineering and IT March – July 2012