0 Up votes0 Down votes

48 views4 pagesmatlab

Mar 14, 2015

© © All Rights Reserved

PDF, TXT or read online from Scribd

matlab

© All Rights Reserved

48 views

matlab

© All Rights Reserved

- ENGG953 Spring2016 Lectures Lecture Bayesian Theorem Posterior Probability
- Ian Stewart 17 Equations That Changed the World Topten List From Author
- option Strategies
- The Motley Fool “Options Edge” Handbook
- VBA
- Project VBA Project Guru (1)
- Axioms of Probability a Probability Function p
- Range-bound trading continues
- Apple vs. FBI Motion to Vacate
- Implied Volatility
- Historical Volatility
- Old-School Theory is a New Force - Bayesian Probability
- matlab
- Implied Volatility Report_Group 1
- Volatility Calculation
- Option Money
- How to Build Correctly Ordered Sentences in English
- Philosophical Foundations
- vba
- Implied Volatility

You are on page 1of 4

187/190

MATLAB

Some commands in Matlab, spring 2013. Corrections and comments to t613015@cis.hut.fi, thank

you!

See also Matlab exercises found in Noppa and list of course material in http://www.cis.hut.fi/

Opinnot/T-61.3015/Matlab/

Command

Description

quit

terminates Matlab session

help

lists all function directories available

help function

gives help on function, e.g. input arguments

doc function

gives help and examples on function

type function

shows the code of function, which are not build-in

pause

waits until the user presses any key

pause(s)

waits s seconds

more

pauses scrolling

who,whos

lists all variables

diary

copies user commands into a file

ver

lists all toolboxes (versions) available

! OS-command

calls command in operating system

%

starts the comment till the end of line

;

does not print anything on screen

disp

prints matrices or text nicely on screen

size

gives dimensions of the matrix (vector)

length

gives the length of the vector

fliplr, flipud

flips the order of items in an array, x[n] x[n]

xstart : intercreates a vector starting from xstart with interval interval and ending

val : xstop

at least in xstop

linspace

creates a linearly spaced vector

File I/O

load

opens a MAT binary file containing variables

load -ascii

opens a formatted ASCII file

save

saves the variables into a MAT binary file

textread

reads a formatted text file into Matlab workspace

dlmread

reads a formatted file of numbers into Matlab workspace

fopen

opens a file

fclose

closes a file

fprintf

writes into a file

fprintf(1,...)

writes into a file handle 1 = on screen

sprintf(1,...)

writes into screen or code

Elementary functions

+

*

scalar / matrix product

/

power

continued on next page

188/190

MATLAB

Command

Description

.

.

mod

rem

cos

sin

atan

atan2

sqrt

exp

log

log2

log10

abs

angle

real

imag

roots

sum

mean

std

var

Plotting

plot

stem

clf

cla

shg

close all

subplot

grid on

title

xlabel

ylabel

legend

axis

print

saveas

semilogx

semilogy

loglog

get

set

findobj

Audio

wavread

soundsc, sound

conjugate transpose

tranpose

itemwise operation, e.g. x.*y, sum(x.^

2)

modulus after division

remainder after division

angle of a complex number, e.g. H(ej )

real part of a complex number

imaginary part of a complex number

calculates roots of a polynomial

sums elements column-wise, sum(x,2) row-wise

computes mean column-wise, mean(x,2) row-wise

standard deviation

variance

plots continuous signals

plots sequences

clears the current figure

clears the current axis

the active window is brought on top

closes all windows

creates several axis in a window

inserts a grid on figure

title for a figure

title for x-axis

title for y-axis

creates a legend for a figure

zoom the axis, axis([xmin xmax ymin ymax]), or axis equal

exports a figure into a file or prints it to a printer

exports a figure into a file

plot with logarithmic x axis

plot with logarithmic y axis

plot with logarithmic xy axis

gets values of an object, e.g. p = plot(..); get(p)

sets values of an object, e.g. p = plot(..); set(p,LineWidth,2)

finds objects with certain properties

reads a WAV file into Matlab

plays a vector as sound (sc = scaled)

continued on next page

189/190

MATLAB

Command

Description

wavwrite

writes a WAV file from Matlab

DSP functions, see Signal Processing Toolbox

fft

DFT, fast Fourier transform

ifft

IDFT, inverse Fourier transform

spectrogram

spectrogram

dftmtx

computes a matrix W for DFT

unwrap

eliminates jumps in phase angles

conv

linear convolution of two sequences

conv

polynomial multiplication

filter

filters signal x with a given filter

impz

impulse response for a discrete-time finite-dimensional system

freqz

draws frequence response, magnitude and phase response

zplane

plots a pole-zero-diagram

residuez

partial-fraction expansion of z-trasform H(z)

tf2zp

converts transfer function to corresponding zeros and poles

tf2sos

converts transfer function to corresponding set of second-order systems

buttord,

filter design: estimates the minimum order for fulfilling specifications

cheb1ord, ellipord

butter, cheby1,

filter design: computes filter coefficients

ellip

fir1

one of FIR filter design procedures, window method

fir2

frequency sampling method for FIR filter design

firpm, firpmord

one of FIR filter design procedures, Parks-McClellan

firls

FIR filter design by least-squares

T-61.3015 functions and scripts, see http://www.cis.hut.fi/Opinnot/T-61.3015/Matlab/

setfontsize

modify font sizes of figures

a2dR

quantization of bits

delta

[n]

mu

[n]

tf2latex

prints transfer function on screen

imp2latex

prints impulse response on screen

phasor.m

phasor example, [L0165][T5]

demoFIRwindowDB.m example on window functions

Control loops

for .. end

if .. end

switch .., case

.., otherwise,

end

Note that when using Octave (with SourceForge packages http://octave.sourceforge.net), spectrogram specgram, firpmord remezord, firpm remez.

190/190

MATLAB

0.5

M = length(x);

t = [0 : M-1]/fT;

plot(t, x); grid on;

title(My vowel /o/); xlabel(time (s));

axis([0.1 0.14 -0.8 0.8]);

soundsc(y, fT);

Compute a FFT X(ej ) from the whole sequence and plot

the spectrum.

xF = fft(x);

M = length(xF);

w = fT * [0 : M-1]/M;

plot(w, 20*log10(abs(xF))); grid on;

title(Spectrum); xlabel(freq. (Hz));

set(gca, XLim, [0 fT/2]);

0.5

0.12

0.13

0.14

300

200

100

0

0

2000

4000

0

20

Magnitude (dB)

Design an elliptic IIR lowpass filter with cut-off 0.3 and plot

the frequency response |H(ej )| and a pole zero diagram.

40

60

80

100

1000

2000

3000

Frequency (Hz)

4000

5000

1000

2000

3000

Frequency (Hz)

4000

5000

Phase (degrees)

Wp = 0.3; Ws = 0.36;

Rp = 0.5; Rs = 40;

[N, Wn] = ellipord(Wp, Ws, Rp, Rs);

[B, A] = ellip(N, Rp, Rs, Wn);

freqz(B, A);

zplane(B, A);

100

200

300

400

Wp = 3300 / (16000/2);

N = 15;

[B, A] = fir1(N, Wp, hamming(N+1));

[H, w] = freqz(B, A, 1024, 16000);

plot(w, abs(H));

0.8

0.6

0.4

Imaginary Part

Hamming window of order 15, plot the frequency response

|H(ej )|.

0.2

0

0.2

0.4

0.6

0.8

1

1

0.5

0

Real Part

0.5

- ENGG953 Spring2016 Lectures Lecture Bayesian Theorem Posterior ProbabilityUploaded byNasir Naeem
- Ian Stewart 17 Equations That Changed the World Topten List From AuthorUploaded byjibaowl
- option StrategiesUploaded byPradeep Singha
- The Motley Fool “Options Edge” HandbookUploaded byapi-25895447
- VBAUploaded byVinay Shekar
- Project VBA Project Guru (1)Uploaded bypvenky_kkd
- Axioms of Probability a Probability Function pUploaded bylocalhost0
- Range-bound trading continuesUploaded byTrading Floor
- Apple vs. FBI Motion to VacateUploaded byAndy Greenberg
- Implied VolatilityUploaded bybhavnesh_mutha
- Historical VolatilityUploaded bybhavnesh_mutha
- Old-School Theory is a New Force - Bayesian ProbabilityUploaded byMahyuddin Husairi
- matlabUploaded bySajidh M Shamsudeen
- Implied Volatility Report_Group 1Uploaded bySiti Maghfirotul Ulyah
- Volatility CalculationUploaded byFaisal Koroth
- Option MoneyUploaded byATR
- How to Build Correctly Ordered Sentences in EnglishUploaded byvanvun
- Philosophical FoundationsUploaded byHannah Faye Valencia
- vbaUploaded byEarnest Reigner Bahian
- Implied VolatilityUploaded bykaruthi_1979
- Example of Perfect, Beautiful English sentences for Story WritingUploaded byDinnKotaz
- Matlab Lecture 1w03Uploaded byjoe1915
- Bayesian analysisUploaded bydequanzhou
- Bayesian EstimationUploaded bynitin30
- The Value of VolatilityUploaded bygr8fun5052
- Lecture 11Uploaded byMudassir Ali
- Volatility Stop SystemUploaded bySimone Mercer-Huggins
- vba sampleUploaded bysaileshbehera

- Deepwater Gulf of Mexico Development Challenges OverviewUploaded byAl Hafiz Ibn Hamzah
- Jack (Device) - Wikipedia, The Free EncyclopediaUploaded bysinghshrutis27
- Capacitacion ContinuumUploaded byfolveras
- Half Bridge ConverterUploaded bytarx441
- MCQs on Stacks With AnswersUploaded byBabuLalSaini
- FOOT ANTHROPOMETRY DEVICE AND SINGLE OBJECT IMAGE THRESHOLDINGUploaded bysipij
- 57653 Solomon, NUploaded byMacarena Aguilera Lira
- VFR GuideUploaded byKonstantinos Airman
- ERKE Group, IHC September 2010Uploaded byerkegroup
- KOM-UNIT-1Uploaded byMuthuvel M
- Tall Building Structures Analysis and Design PDF - Google SearchUploaded bymb5bariya
- Horn AntennaUploaded byFunda Güt
- Enterprise Resource PlanningUploaded byAndreea Dragomir
- 4 Point SystemUploaded bytex_hasan_014
- SCES2013 Tusar ModifiedUploaded byTusar Kumar Dash
- Photoshop Intermediate Reference GuideUploaded bytostes_br
- Star and DeltaUploaded bygeorgeowen
- Vitamix 6300 Owners ManualUploaded byGustavo Caicedo Castrillón
- PMP Study Notes Formula GuideUploaded byandypats
- vcoUploaded byanon_502961563
- It Project1Uploaded byJhon Davo
- NdeUploaded byAjit Patil
- Heck Reaction HighlightUploaded byChris Raynor
- The Effects of Soot-contaminated Engine Oil on Wear and FrictionUploaded byAssimilator1
- Software Testing PhasesUploaded byEngr Syed Yahya
- Valvetronic enginessUploaded byMarie-belle Challita
- overview.pdfUploaded byMinu Mathew
- HTHA High Temperature Hydrogen Attack Exposed SteelUploaded byaecf_13
- Pecha-Kucha Agile 2011 Peter SaddingtonUploaded byPeter Saddington
- Article 70Uploaded byRaj Kumar

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.