0% found this document useful (0 votes)
21 views

Matlab: A Brief Tutorial Signals & Systems Instructor: Dr. Sameti

This document provides an overview of MATLAB basics including: - Matrix definitions and operations such as addition, multiplication, element-wise operations - Sequences and selecting elements from matrices - N-dimensional arrays and their sizes - Concatenating and finding values in matrices - Common matrix functions such as zeros, ones, eye, reshape, transpose - Symbolic math toolbox for solving equations and integrals - Fourier transforms and their inverses for transforming signals between time and frequency domains

Uploaded by

saeedmmmm
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Matlab: A Brief Tutorial Signals & Systems Instructor: Dr. Sameti

This document provides an overview of MATLAB basics including: - Matrix definitions and operations such as addition, multiplication, element-wise operations - Sequences and selecting elements from matrices - N-dimensional arrays and their sizes - Concatenating and finding values in matrices - Common matrix functions such as zeros, ones, eye, reshape, transpose - Symbolic math toolbox for solving equations and integrals - Fourier transforms and their inverses for transforming signals between time and frequency domains

Uploaded by

saeedmmmm
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

MATLAB

a brief tutorial Signals & Systems Instructor: Dr. Sameti Created by: Saeed Mirzamohamadi Ali Fakhrzadegan

Matrix basics
Definition:

A = [ 1 2 3; 4 5 6 ]

Matrix

operators

*/+-^ Element wise operators


.*

./ .^

Matrix basics
Sequences

1:3 = [ 1 2 3 ] 5:-2:1 = [ 5 3 1 ]
A=[1234] A( 1:3 ) = [ 1 2 3 ] A( 2:end ) = [ 2 3 4 ] A( end ) = 4

Selectors

Matrix basics
N-Dimensional

Definition B( :, :, 1 ) = [ 1 2; 3 4 ] B( :, :, 2 ) = [ 5 6; 7 8 ] B( :, :, 3 ) = [ 9 10; 11 12 ] Size( B ) = [ 2 2 3 ] So B is 3D-Array.

Matrix basics
Concatenation

A = [ 1 2 3 ] and B = [ 4 5 6 ]
[

A;B ] = [ 1 2 3; 4 5 6 ] [ A, B ] = [ 1 2 3 4 5 6 ]
Find

matrix values

Result = A > 2 Indices = find( A <= B ) [ row, col ] = find( A== 2 )

Matrix basics
Functions

Zeros, ones, eye


eye(

2 ) = [ 1 0; 0 1 ]

Reshape

Change shape of a matrix A. or A min, max, mean, sum

Transpose

Statistical

Symbolic math toolbox


syms

xy Equations

solve( x^2 1 ) diff(x^3 +2*x^2 ) int(1/x)

= -1, +1 = 3*x^2+4*x =log( x )

Fourier and Inverse Fourier Transform


1-Dimensional

fft ifft
fft2 ifft2

Fast Fourier Transform Inverse Fast Fourier Transform


2D Fast Fourier Transform 2D Inverse Fast Fourier Transform

2-Dimensional

Complex

operations
extract imaginary/real part of the number

imag, real

You might also like