48 views

Uploaded by SubratKumarKar

matlab

- Matlab Lecture 1w03
- Implied Volatility Report_Group 1
- ENGG953 Spring2016 Lectures Lecture Bayesian Theorem Posterior Probability
- The Value of Volatility
- Old-School Theory is a New Force - Bayesian Probability
- Bayesian Estimation
- Axioms of Probability a Probability Function p
- Volatility Calculation
- vba
- Implied Volatility
- Option Money
- Historical Volatility
- Bayesian analysis
- Range-bound trading continues
- Project VBA Project Guru (1)
- Example of Perfect, Beautiful English sentences for Story Writing
- matlab
- VBA
- vba sample
- The Motley Fool “Options Edge” Handbook

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

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

- TargetLink Product-InformationUploaded bymazher_ec
- Practical Signal Processing Using MATLABUploaded byAvinash Nandakumar
- New Microsoft Word DocumentUploaded byNor Alhuda
- Graphics and GUI theory Using MatlabUploaded bySaloni Agarwal
- Automated HighwaysUploaded bySateesha Baraker
- How To Make Calculator with Matlab GUIUploaded byJans Hendry
- MatPlotLibUploaded byoidaadm
- Lab 07Uploaded byOla Sbihat
- thesis_7_28_07Uploaded byChirag Borkar
- Matlab Intro 100217Uploaded bymailmuncher2000
- PCMUploaded byfaridadamabdillah
- An Introduction to ScilabUploaded byGourav Kumar
- Wiemer 2001 - ZMAPUploaded byJose Roman Miranda
- NAbook Aug 2008Uploaded byRohit Dhir
- MATLAB SimulinkUploaded byMoorthi Velu
- Sagar Suresh Srikant ResumeUploaded byms2sagar
- IFEM.ch04.SlidesUploaded byShoyeeb Ahmed
- MatlabUploaded byHamid Si
- Transformer Testing and Analysis using MATLAB/SimuinkUploaded byIJIRST
- Stebner PaperUploaded byAnik Das
- Simulink Code GenerationUploaded byKen Le
- 91-92 Software Voice Identification Dec 14Uploaded byJITENDRA41085
- Dina Mics i Mule Lec MachinesUploaded byfmambel
- ECP Lab1 Simulink Intro r4Uploaded bykeyboard2014
- BS Lab ManualUploaded bya_anurag1994
- Curs 0 Introducere in MatlabUploaded byCorinaPîrvu
- Sonnet Users Guide v13Uploaded bySriram Muralidharan
- fmri data analysis matlabUploaded byoumeigan
- APT3F1706CYB CE00336 6 IPCV Incourse AssignmentUploaded bycaleb tee
- Setup of Rotary Flexible LinkUploaded bykeyboard2014