0% found this document useful (0 votes)
35 views16 pages

Anubhav Mat Ab

The document provides an introduction to MATLAB including its overview, key applications, basics of the MATLAB interface and windows, data types, file types, basic commands, variables and operations, flow control, and examples of in-lab and post-lab exercises. It aims to provide learners with fundamental MATLAB skills and computational proficiency.

Uploaded by

pegoce1870
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views16 pages

Anubhav Mat Ab

The document provides an introduction to MATLAB including its overview, key applications, basics of the MATLAB interface and windows, data types, file types, basic commands, variables and operations, flow control, and examples of in-lab and post-lab exercises. It aims to provide learners with fundamental MATLAB skills and computational proficiency.

Uploaded by

pegoce1870
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

SIGNALS AND SYSTEMS LAB

ODD SEM -2023

COURSE CODE - 18B15EC214

SUBMITTED BY -
NAME – ANUBHAV KAUSHIK
ENROLL. NO – 22102035
BATCH – A2

ANUBHAV KASUHIK 22102035


Objective: Introduction to MATLAB and its diverse applications.

MATLAB Overview:
MATLAB® serves as a powerful language for technical computation. It seamlessly integrates
computation, visualization, and programming within an intuitive environment. Mathematical
problems and solutions are expressed using familiar mathematical notation.

Key Applications:
MATLAB finds utility in various domains, including:
- Mathematics and Algorithm Development
- Data Acquisition and Processing
- Modeling, Simulation, and Prototyping
- Data Analysis, Exploration, and Visualization
- Scientific and Engineering Graphics
- Application Development, including GUI Building

MATLAB Basics:
1.MATLAB Windows:
- MATLAB Desktop: Launch MATLAB by double-clicking its icon. The desktop
comprises sub-windows:
a. Command Window: Input variables, execute functions, and scripts. Use the MATLAB
command prompt (>>).
b. Current Directory: Lists files in the current directory. Perform actions like running,
renaming, or deleting files.
c. Workspace: Holds variables created during the session.
d. Command History: Logs entered statements; rerun, copy, or create M-files from this
history.
- Figure Window: Displays graphics output separately.
- Editor Window: Create and debug M-files (scripts) with a graphical user interface.

2. Input-Output:
- Data Types: Work with matrices and arrays of various data types, including numbers,
characters, strings, logical values, and more.
- Dimensioning: MATLAB handles automatic dimensioning of arrays.
- Case Sensitivity: MATLAB is case-sensitive for variable names, function names,
filenames, objects, and classes.
- Output Display: Command output displayed in the Command Window. Use a semicolon
to suppress output.
- Output Format: Control display format using commands like "format short e" or "format
long e."

ANUBHAV KASUHIK 22102035


3. File Types:
- M-files: Write programs in ASCII text files with a .m extension. Execute using the
filename.
- MAT-files: Save and load MATLAB arrays using .mat files.
- Fig-files: Binary files with a .fig extension that can be opened as figures in MATLAB.
- P-files: Save a preparsed version of a function or script.
- Mex-files: MATLAB callable FORTTRAN and C programs with a .mex extension.

4. Conversing with MATLAB and General Commands:


Use commands like
who - MATLAB replies with the variables in your workspace.
whos - MATLAB replies with the variables in your workspace with their size.
what - MATLAB replies with the current directory and MATLAB files in the directory
clear – clears variables from environment
clear all - clears all variables from environment
clear a b - look at workspace, the variables a and b are gone
clc/home - clears the cluttered command window. Etc

5.Variables and Operations:


- Initialize variables using values or expressions.
- Perform scalar operations like arithmetic (+, -, , /), exponentiation (^), and more.
- Apply element-wise functions to vectors.
- Perform matrix indexing and access submatrices.

6.Flow Control:
- Use relational operators (<, >, <=, >=, ==, ~=) for comparisons.
- Employ logical operators (&, |, ~, xor, all, any) for logical conditions.
- Use if/else/elseif for conditional execution.
- Utilize for loops for a specified number of iterations.
- Apply while loops for repeated execution based on a condition.

These fundamentals of MATLAB provide a foundation for further exploration and application
in diverse technical fields.

ANUBHAV KASUHIK 22102035


IN LAB EXERCISE

1. Making and Manipulating Variables


a=10;
c=1.3*45-2*a;
cool=13/3;

2. Row and column vectors


row=[1 2 34 55]
r=[1, 2 ,3 44, 99]
col=[11;22;33;44]
size(row)
size(r)
size(col)
length(row)
length(col)

3. Making matrices like vector


a= [1 2; 3 4]
a = [1 2]
b = [3 4]
c = [5; 6]
d = [a; b]
e = [d c]
f = [[e e] ; [a b a]]
str = ['Hello, I am ' 'John']

ANUBHAV KASUHIK 22102035


4.Basic scalar operations
l=7/45
b(1+i)*(2+i)
c=1 / 0
d=0 / 0
e=4^2
f=(3+4*j^2
g=((2 + 3) * 3) ^ 0.1
a= [1 2 3 4+i]
transpose(a)
a'
a.'

5.Built- in functions
a=sqrt(2)
b=log(2),
c=log10(0.23)
d=cos(1.2),
e=atan(-.8)
f=exp(2+4*i)
g=round(1.4),h=floor(3.3),
i=ceil(4.23) j=angle(i), k=abs(1+i)

6.Element-wise functions
t = [1 2 3]
f = exp(t)
g = [exp(1) exp(2) exp(3)]
a = [1 2 3]; b = [4; 2; 1]
a.*b, a./b, a.^ b
a.*b',a./b',a.^(b')

ANUBHAV KASUHIK 22102035


7.Automatic Initialization
o=ones(1,10)
z=zeros(23,)
r=rand(1,45)
n = nan(1,69)
var=zeros(M,N)
a = linspace (0, 10 ,5)
b=0:2:10

ANUBHAV KASUHIK 22102035


ANUBHAV KASUHIK 22102035
ANUBHAV KASUHIK 22102035
ANUBHAV KASUHIK 22102035
POST LAB EXCERSISE

ANUBHAV KASUHIK 22102035


ANUBHAV KASUHIK 22102035
ANUBHAV KASUHIK 22102035
ANUBHAV KASUHIK 22102035
ANUBHAV KASUHIK 22102035
ANUBHAV KASUHIK 22102035
LEARNING OUTCOMES
The exercise involving the utilization of MATLAB's inbuilt functions and operators can lead
to a wide range of valuable learning outcomes for participants. Here are potential outcomes:

1. Data Type Comprehension: Participants will develop a deeper grasp of various data
types within MATLAB, including numeric arrays, logical values, and strings. They will
learn how to effectively manipulate and perform operations on these data types.

2.Mathematical Proficiency:Through practical exercises, participants will master diverse


mathematical operations using MATLAB's pre-existing functions and operators. This
encompasses fundamental arithmetic computations (addition, subtraction, multiplication,
division), exponentiation, and more.

3. Array Handling Skills:Participants will attain proficiency in manipulating arrays,


acquiring skills to perform tasks like indexing, slicing, and reshaping using MATLAB's
readily available functions.

4. String Manipulation Expertise: Understanding of string manipulation, concatenation,


and formatting will be gained as participants work with MATLAB's string functions.

5. Visualization Aptitude:Hands-on experience with MATLAB's plotting functions will


enable participants to create a variety of plots and effectively visualize data.

6. Function Creation and Usage: Participants will cultivate the ability to craft their own
functions, subsequently incorporating these functions within MATLAB scripts.

7. Numerical Algorithm Implementation:Participants will explore and apply numerical


algorithms using MATLAB's inherent functions. This entails tasks like root finding, solving
equations, and numerical integration.

In essence, this exercise will establish a strong foundation in MATLAB programming,


equipping participants with invaluable computational competencies that can be effectively
applied in their academic and professional endeavors.

ANUBHAV KASUHIK 22102035

You might also like