Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
64 views
Matlab Basic Functions
Matlab Basic Functions
Uploaded by
Sujay S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Matlab Basic Functions For Later
Download
Save
Save Matlab Basic Functions For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
64 views
Matlab Basic Functions
Matlab Basic Functions
Uploaded by
Sujay S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Matlab Basic Functions For Later
Carousel Previous
Carousel Next
Save
Save Matlab Basic Functions For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
@A MathWorks: MATLAB® Basic Functions Reference ele Cle command window Define variable a with valve 5 help fun Display inline help for fun doc fun ‘Open documentation for fun Toad(“filenane™ "vars oad voriables from -mat He Ulisport(filenane) ‘Open interactive impor tool ve("Filename®y vars! Save voriabler fo file clear item Remove ms from workspace exanplescripe Run the script fle named examplescript format style ‘Set ouput dieplay format ver Get lst of inealed toolboxes tie, tee ‘Stat! ond sop timer cesne ‘Abort the eutentcalevltion ee Operators and Special Characters ‘Matrix math operations ‘Array muliplication and division nite operations) Matrix and array power ae G2 ase Ae a23 Define A os @ 2x3 matrix “space” separates columns "For new line separates rows Coneaierole arrays horizonally Coneatenate arays vertically Change ath element of x10 7 aa.) ‘Change Afi) 10 5 eo) ‘Get Sth 10th elements of x (Bend) ‘Get every 2nd element of x [Ist fo las xe in elements greater than & xGessi0)= ‘Change elements ving condition aw Get Ath row of A Ae, 3) (Get Sed column of A ALG, 25) ‘Get 2nd fo Sih element in 6h row of A AGB TAG? DD ‘Swap the Ist and 7th column = [ool 42, at] with eens wae ‘Creale regularly spaced vector wih spacing de Left division or line transpose 1 eplimization ‘Normal and complex conjugate Linspace(a.b in) ‘Create vector of n equally spaced valves Togepace(s.b.n) ‘Create vector of logerthmicely spoced values Tibia ie a eteing™ wtrl + stra Definition ofa sting ‘Append sings Seen ==) =) & >) Ss) >= | Relational operators | [rerostm.n {Creale m xn matrix of zer08 wel a wer Tole operaions | tm Create mx n matrix of ones IAND, NOT, OR, KOR) even) Create @ nx identity max ‘Suppress ouput display Bediag=) ‘Create diagonal matrix from vector - ‘Connect lines (vith break) xediag(a) {Get diagonal elemen's of matix + Description Comment eshgrid(y) Creaie 2D and 3D grids ‘welio" Defintion ofa character vector Fand(a,n), andi ‘Create vnifornly distributed random umber: of inte randn(sn) ‘Create normally distrbuted random umber: (ero ced ane ‘Most recent answer Add Imaginery unt PE io3.141592654, reals) Real part of complex number a Imaginary ont inag(=) Imaginary part of complex number Yaw, man Not e number fie, division by zoe] angle) Phare ongle in radians Ent, int Tafinty cong Elomentwise complex conjugate ops Hating pain relative accuracy iereal(2) Determine whether array is relA&A MathWorks: as nt), asin Sine ond inverse argument in radians) lot (x,y, Linespec) Plot y vs x Tenabiy ated Sov end ven ergnertin arg] | U3 ioeesinarinsh inh), aeinh Hyperbole sine and inverse (rin Markos Leeetyle, maven, nd ests eee oe | ree Tosa is gc bs ous mere Ales ff Wr Sie ear n+ | UtPidine wih nates abs(x) Absolvte valve of x, complex magnitude Satlecrieie") Add plot fitle oan Acie Teqenatiae ae) [nl egnd ar sgrt(x), nthroot(x,n) | Square root, real nth root of real numbers x/y/zlabel("label") Add x/y/z xis label = ———e Thivcckattickavec) | Setar ay une resto oad ieguibm ihe 2 and mayen | | ply/sickiabeistianeiay| Ge oro vee ae ob eterna Romain Thfecikaosielansie) | Yoon ys eel san) win Celery ove wean d Sarin ro waists) eels vee | Sea td a Selib Finy Beer | pom rd ak a exci) nadie 7 taunt ser doin ape gris oloft Show oad wo eee Tet be cmv cao Sorhomt capstan Cre sn led potion ‘table(vart,...,vasi) ‘Create table from deta in variables eiledlayout(in.n) core pris tthe | Geum nemo Fase Gaile on fe fee Coie gre window sereyaeanio Cant a aye set 5 Ga coal lgoe, ga aE Fone tated dats fon clove oe Con ore igre rors alsa Cea ew wih ecied | [ eae aE Sis nen as Heowspecrreniwn | Sotael Succ rs Tenia Reet BT Connon Pt pen a eens repent ‘categorical (a) Creale a calegerical ervey a a ron, orcopsunneny | Pint snnary a ble R Sein, Fh Tan ew cmon oe ee ae & (MW aa Tasks (Live Editor) ee = = Live Editor tasks are apps tho! ean be added fo a lve scrip 0 interactively perform a specific set of operations. Tasks represen’ a series of MATLAB ‘commands. To vee the commands that he tsk runs, show the generated code ‘Common asks available from the Live Edt tab on the desktop tooltip + Cleon Missing Dato + Clean Outer + Find Change Point + Find Local Exroma Flot Gallery: mathworks com/product/malab/plat gale + Remove Tends + Smooth Data " ° poy Se ee at@A MathWorks: oes pen Functions fxero(fon,x0) Roat of nonlinear function jeript fle. Function files must have the § sane name as the 1st function fonction cavg = cumavg(x) multiple args. possible cavgzcunun(vec)./(:tength(vee))? ‘Eminsearch(fan x0) Find minimum of function ‘Eninbad (fn x1, x2) Find minim of fam in el x2] eG), Leet Feast Fourier ransform and it inverse ‘Anonymous Functions Integration and Differentiation © defined via function handles fun = @(x)_cos(x.n2)./abs (3): integrailé.a,b) ‘Numerical integration {enalagovs functions for 2D and 30) Af, elseif Conditions erape te) Trapezoid numerical integration Control Structures aire Diferences and epproximate derivatives geedient) Numerical gradient Af nao aéep('n sealer 10") elseié nce20 disp(-n between 10 and 20") Curl OK BUM) Curl and angular velocity ivergence(k,.-.¥) Compute divergence of vector fle ‘edets (ode tepan.vo) Solve system of nonsiff ODEs disp(inagative one") case (0,2,2,3) + check four cases together isp("intager between 0 and 3°) otherwi: diep("integer value outeide interval [-1,31") fend control structures terminate with end Pdevai (n,xmesh, susol xa) else ‘étepira larger then 20°) ‘edeise(ode,tepany0) | Solve wystem of stiff ODE ‘Sch Cave deval(eol,») Evaluate sltion of diferentiel equetion = Enput(Enter an integer! ")y ‘Paope (a pde, ic, Solve 1D partial differential equation switch n ‘be xm,t8) case “1 Interpolatenumerie PDE soution Interpolation and Polynomials Forloop interpltew xa) 1D interpolation {enalagous for 2D and 30) © loop specific number of times, and keep % track of each iteration with an incrementing % index variable for = 1:3 Aisp(‘cool") end control structures terminate with end Pehiptew.a) Piecewise cubic Hermite palynomial Interpolation spline twa) Cubic spline date interpolation ppvailep xa) Evaluate piecewite polynomial smkpp (breaks coefts) Make piecewise polynomial While-Loop ‘SBRKPPIPP Extract piecewise polynomial details % loops as long ae @ condition remains true asa pFactorial = 1; while nFactorial < 14100 nent: nFactorial = nFactorial + n: fend § control structures terminate with end poly) Polynomial with specified root x ‘polyeig(A0,A1,..-/AP) Eigenvalues for polynomial eigenvalue problem polyeittea) Polynomial curve fiting Further programming/contol commands Feaiaue(al Poriel facion expanion/decomposton roots tp) Pelynomil rots polyvalip Evaluate poly po point x olvinee) Pelyronialineprtion polvaer(e) Pelyromildifereniaton break Terminate execution of for of whileoap continue Pass contralto the next iteration ofa loop try, eaten mathworks.com/help/matlab<@ MathWorks: ‘Accoerting the pace of engineering and science Matrices and Arrays Deseri ive Statistics Bengeniad Length of largest array dimension sun(), prod Sum or produc long colynns) “ize ‘Array dimensions ax(R), Bis, Bounds | Lorgest ond smelt element mune ‘Number of elamens in oray ean), sedian, mode | Silsieal operations =) Sor erayeleenis sea, ver Stndard devin ond variance sortrows@) Sor rows of eray or tobe ‘oveun(A,A), movpred, | Moving saical functions movaax, movmin, i= length of moving window nig lip order of elements in arr “e " Pe) Fip order of ay movnean, novmedian, ‘squeeze Remove dimensions of length 1 ovata, sowear Feshapetavez) | Reshape array cunsua(), cumpred, | Cumulative sainical hnctons repmat(A,n) Repeat copies of array comme, cummin any), at Check ifanyall elements are nonzero [_sncorndareta) __|_ Smooth nety data ny Naber ronsvoavey doves istcounes 00 elevate histogram bin counts on Need eh eee sea corrcoet(h), cow Correlation coofcons, coverince xeore(ea), cor Cron -orelaion, ers-covaance ‘neo Algebra aermalize(a) Normalize data datendic) Remove polynomial wend anki ork of matic om ork of matr Teoutiierta) erace(n) Sum of dogonal element of marx ase) Determinant of marx poly(A) ‘Character polynomial of matte Sypatiets Os sigiA), cigs Eigenvalues and vectors of matrix (subse!) xe syns * YE Declare symbelic variable Envi), Pinw Inverse and pioudo inverse of mati wery mee Define «symbole eavation orn ‘Nowm of vecor or mati solve eqne ware) Solve symbolic expresion forveriabe expat), logs | Matrix exponentl and logarithm = = ' tube (eape var wall tive variable exprension ez00s(a8) ‘ross produe = eee soc.) Det ped [-ssesnstenee) __] fered boc naresien__] ‘kxon(A,B) Kronecker tensor product | simplityexp) TT e > |_Fectorize symbols exprenion _| = ere Binplity (exp Simpy symbole expression orth(a) Orthonermal basis for matrix range: {hake asempien for veriotle ee ° 7 Show estumption for 5 Lower end upper riongular pat of max yakole sheer Linsolve(A,B) Solve linear system of the form AX=B Eplot(expe), feontour, Plotting functions for Tequinnora(A.B) | leostiqvores soliton 1 Ineor equation faurt, fear, timplicit | symbole expressions GOD, 3, enol | Mak decomposition: ite (expe vara) Diferentie symbole exprenion 7) ‘Singular valve deconpostion ‘deolve(deqn, cond) Sole differential gevaiaB) ‘Generalized SVD |__| eqvetion symbolically _| Fee) Reduced row echelon form of matrix |_Antlexprivarsta, PI) | Integrate symbole expression _| taylor (fun,va £0) Taylor expansion of fneon *requires Symbolic Math Toolbox mathworks.com/help/matlab ©2001 Th ios, he MATA ier poder ond sans ay Sms pred acento he ahs, ne So maha con/nedmat oo ford rademats
You might also like
Basic Simulation Lab File
PDF
67% (3)
Basic Simulation Lab File
53 pages
Matlab Basic Functions Reference
PDF
No ratings yet
Matlab Basic Functions Reference
4 pages
Matlab Basic Functions Reference
PDF
No ratings yet
Matlab Basic Functions Reference
4 pages
Matlab Commands
PDF
No ratings yet
Matlab Commands
6 pages
MATLAB Workshop 2022
PDF
No ratings yet
MATLAB Workshop 2022
12 pages
MATLAB Fundamentals - Cheat Sheet - Tools Course ETH Z Urich
PDF
No ratings yet
MATLAB Fundamentals - Cheat Sheet - Tools Course ETH Z Urich
2 pages
Tutorial Matlab
PDF
No ratings yet
Tutorial Matlab
89 pages
Intoduction To Atlab
PDF
No ratings yet
Intoduction To Atlab
59 pages
Intoduction To Atlab: M. Subramanian
PDF
No ratings yet
Intoduction To Atlab: M. Subramanian
58 pages
MAT290 Matlab Module1
PDF
No ratings yet
MAT290 Matlab Module1
12 pages
Matlab Workshop
PDF
No ratings yet
Matlab Workshop
81 pages
Introduction To MATLAB and Basic Signals: Definition of Variables
PDF
No ratings yet
Introduction To MATLAB and Basic Signals: Definition of Variables
19 pages
Introduction To Matlab, Signal Processing & Speech Signal Processing
PDF
No ratings yet
Introduction To Matlab, Signal Processing & Speech Signal Processing
49 pages
Matlab Lecture 6
PDF
No ratings yet
Matlab Lecture 6
70 pages
Matlab Tutorial PDF
PDF
No ratings yet
Matlab Tutorial PDF
12 pages
Basic Simulation Lab: Amity School of Engineering Amity University - UTTAR PRADESH
PDF
No ratings yet
Basic Simulation Lab: Amity School of Engineering Amity University - UTTAR PRADESH
24 pages
Matlab Vit
PDF
0% (1)
Matlab Vit
73 pages
Reference Card MATLAB
PDF
No ratings yet
Reference Card MATLAB
4 pages
Basic Simulation Lab File (Es-204) : Ravi Kumar A45615820008 B.Tech Ce 4 SEM
PDF
No ratings yet
Basic Simulation Lab File (Es-204) : Ravi Kumar A45615820008 B.Tech Ce 4 SEM
49 pages
S&S Lab1-13 PDF
PDF
No ratings yet
S&S Lab1-13 PDF
49 pages
Lab Experiment 1 (A)
PDF
No ratings yet
Lab Experiment 1 (A)
14 pages
CE 205-MATLAB For Civil Engineers Irfan Turk Fatih University, 2013-14
PDF
No ratings yet
CE 205-MATLAB For Civil Engineers Irfan Turk Fatih University, 2013-14
12 pages
Introduction To Matlab: By: Amrit Lal Saha
PDF
No ratings yet
Introduction To Matlab: By: Amrit Lal Saha
40 pages
Mae11 Matlab Manual
PDF
No ratings yet
Mae11 Matlab Manual
31 pages
Experiment - 1: Objective: To Implement General MATLAB Commands (General Purpose, Input/output
PDF
No ratings yet
Experiment - 1: Objective: To Implement General MATLAB Commands (General Purpose, Input/output
30 pages
Document From ? 2
PDF
No ratings yet
Document From ? 2
33 pages
MatLab
PDF
No ratings yet
MatLab
42 pages
Matlab Intro
PDF
No ratings yet
Matlab Intro
48 pages
Matlab Notes For Calculus 2: Lia Vas
PDF
No ratings yet
Matlab Notes For Calculus 2: Lia Vas
12 pages
Introduction To Matlab and Manipulation of Functions
PDF
No ratings yet
Introduction To Matlab and Manipulation of Functions
65 pages
Using MATLAB For Linear Algebra
PDF
No ratings yet
Using MATLAB For Linear Algebra
10 pages
MATLAB Cheat Sheet: Useful Commands Vectors/Matrices Operations Vector Indexing
PDF
No ratings yet
MATLAB Cheat Sheet: Useful Commands Vectors/Matrices Operations Vector Indexing
4 pages
Lab(1-6) physics
PDF
No ratings yet
Lab(1-6) physics
38 pages
Lab 2- Overview of MATLAB and Simulink
PDF
No ratings yet
Lab 2- Overview of MATLAB and Simulink
36 pages
Computational Method Lab
PDF
No ratings yet
Computational Method Lab
38 pages
Programming Exercises For R: by Nastasiya F. Grinberg & Robin J. Reed
PDF
50% (2)
Programming Exercises For R: by Nastasiya F. Grinberg & Robin J. Reed
35 pages
Rexercises 1 R Basic
PDF
No ratings yet
Rexercises 1 R Basic
35 pages
Basic Simulation Lab File (4Mae5-Y)
PDF
No ratings yet
Basic Simulation Lab File (4Mae5-Y)
53 pages
Introduction To MATLAB (By DR Wang Fei)
PDF
No ratings yet
Introduction To MATLAB (By DR Wang Fei)
35 pages
MATLAB Basic Commands
PDF
No ratings yet
MATLAB Basic Commands
29 pages
Mac11 Matlab Manual
PDF
No ratings yet
Mac11 Matlab Manual
31 pages
MATLAB As A Calculator
PDF
No ratings yet
MATLAB As A Calculator
2 pages
Viden Io Amity Aset Matlab Practical File Basic Simulation Lab Manual Updated
PDF
No ratings yet
Viden Io Amity Aset Matlab Practical File Basic Simulation Lab Manual Updated
50 pages
Códigos MatLAb
PDF
No ratings yet
Códigos MatLAb
37 pages
MATLAB_1
PDF
No ratings yet
MATLAB_1
31 pages
Lecture 2 - ch2 - Fundamentals
PDF
No ratings yet
Lecture 2 - ch2 - Fundamentals
40 pages
Matlab Review
PDF
No ratings yet
Matlab Review
12 pages
L01 Matlab1
PDF
No ratings yet
L01 Matlab1
15 pages
Numerical Methods For Civil Engineers
PDF
No ratings yet
Numerical Methods For Civil Engineers
15 pages
Numerical Methods For Civil Engineers (MATLAB)
PDF
No ratings yet
Numerical Methods For Civil Engineers (MATLAB)
221 pages
Lab 4 Matlab&Simulink - Training
PDF
No ratings yet
Lab 4 Matlab&Simulink - Training
28 pages
Overview of Programming
PDF
No ratings yet
Overview of Programming
16 pages
Exercise PDF
PDF
No ratings yet
Exercise PDF
8 pages
Matlab Intro PDF
PDF
No ratings yet
Matlab Intro PDF
44 pages
Matlab Introduction Tutorial
PDF
No ratings yet
Matlab Introduction Tutorial
44 pages
LM741 Ic
PDF
No ratings yet
LM741 Ic
17 pages
Mid Term Solution
PDF
No ratings yet
Mid Term Solution
8 pages
Assignment 3 Questions
PDF
No ratings yet
Assignment 3 Questions
5 pages
EM Theory 2023 - Assignment-2
PDF
No ratings yet
EM Theory 2023 - Assignment-2
7 pages
Solution Manual Balanis
PDF
No ratings yet
Solution Manual Balanis
78 pages
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
Basic Simulation Lab File
PDF
Basic Simulation Lab File
Matlab Basic Functions Reference
PDF
Matlab Basic Functions Reference
Matlab Basic Functions Reference
PDF
Matlab Basic Functions Reference
Matlab Commands
PDF
Matlab Commands
MATLAB Workshop 2022
PDF
MATLAB Workshop 2022
MATLAB Fundamentals - Cheat Sheet - Tools Course ETH Z Urich
PDF
MATLAB Fundamentals - Cheat Sheet - Tools Course ETH Z Urich
Tutorial Matlab
PDF
Tutorial Matlab
Intoduction To Atlab
PDF
Intoduction To Atlab
Intoduction To Atlab: M. Subramanian
PDF
Intoduction To Atlab: M. Subramanian
MAT290 Matlab Module1
PDF
MAT290 Matlab Module1
Matlab Workshop
PDF
Matlab Workshop
Introduction To MATLAB and Basic Signals: Definition of Variables
PDF
Introduction To MATLAB and Basic Signals: Definition of Variables
Introduction To Matlab, Signal Processing & Speech Signal Processing
PDF
Introduction To Matlab, Signal Processing & Speech Signal Processing
Matlab Lecture 6
PDF
Matlab Lecture 6
Matlab Tutorial PDF
PDF
Matlab Tutorial PDF
Basic Simulation Lab: Amity School of Engineering Amity University - UTTAR PRADESH
PDF
Basic Simulation Lab: Amity School of Engineering Amity University - UTTAR PRADESH
Matlab Vit
PDF
Matlab Vit
Reference Card MATLAB
PDF
Reference Card MATLAB
Basic Simulation Lab File (Es-204) : Ravi Kumar A45615820008 B.Tech Ce 4 SEM
PDF
Basic Simulation Lab File (Es-204) : Ravi Kumar A45615820008 B.Tech Ce 4 SEM
S&S Lab1-13 PDF
PDF
S&S Lab1-13 PDF
Lab Experiment 1 (A)
PDF
Lab Experiment 1 (A)
CE 205-MATLAB For Civil Engineers Irfan Turk Fatih University, 2013-14
PDF
CE 205-MATLAB For Civil Engineers Irfan Turk Fatih University, 2013-14
Introduction To Matlab: By: Amrit Lal Saha
PDF
Introduction To Matlab: By: Amrit Lal Saha
Mae11 Matlab Manual
PDF
Mae11 Matlab Manual
Experiment - 1: Objective: To Implement General MATLAB Commands (General Purpose, Input/output
PDF
Experiment - 1: Objective: To Implement General MATLAB Commands (General Purpose, Input/output
Document From ? 2
PDF
Document From ? 2
MatLab
PDF
MatLab
Matlab Intro
PDF
Matlab Intro
Matlab Notes For Calculus 2: Lia Vas
PDF
Matlab Notes For Calculus 2: Lia Vas
Introduction To Matlab and Manipulation of Functions
PDF
Introduction To Matlab and Manipulation of Functions
Using MATLAB For Linear Algebra
PDF
Using MATLAB For Linear Algebra
MATLAB Cheat Sheet: Useful Commands Vectors/Matrices Operations Vector Indexing
PDF
MATLAB Cheat Sheet: Useful Commands Vectors/Matrices Operations Vector Indexing
Lab(1-6) physics
PDF
Lab(1-6) physics
Lab 2- Overview of MATLAB and Simulink
PDF
Lab 2- Overview of MATLAB and Simulink
Computational Method Lab
PDF
Computational Method Lab
Programming Exercises For R: by Nastasiya F. Grinberg & Robin J. Reed
PDF
Programming Exercises For R: by Nastasiya F. Grinberg & Robin J. Reed
Rexercises 1 R Basic
PDF
Rexercises 1 R Basic
Basic Simulation Lab File (4Mae5-Y)
PDF
Basic Simulation Lab File (4Mae5-Y)
Introduction To MATLAB (By DR Wang Fei)
PDF
Introduction To MATLAB (By DR Wang Fei)
MATLAB Basic Commands
PDF
MATLAB Basic Commands
Mac11 Matlab Manual
PDF
Mac11 Matlab Manual
MATLAB As A Calculator
PDF
MATLAB As A Calculator
Viden Io Amity Aset Matlab Practical File Basic Simulation Lab Manual Updated
PDF
Viden Io Amity Aset Matlab Practical File Basic Simulation Lab Manual Updated
Códigos MatLAb
PDF
Códigos MatLAb
MATLAB_1
PDF
MATLAB_1
Lecture 2 - ch2 - Fundamentals
PDF
Lecture 2 - ch2 - Fundamentals
Matlab Review
PDF
Matlab Review
L01 Matlab1
PDF
L01 Matlab1
Numerical Methods For Civil Engineers
PDF
Numerical Methods For Civil Engineers
Numerical Methods For Civil Engineers (MATLAB)
PDF
Numerical Methods For Civil Engineers (MATLAB)
Lab 4 Matlab&Simulink - Training
PDF
Lab 4 Matlab&Simulink - Training
Overview of Programming
PDF
Overview of Programming
Exercise PDF
PDF
Exercise PDF
Matlab Intro PDF
PDF
Matlab Intro PDF
Matlab Introduction Tutorial
PDF
Matlab Introduction Tutorial
LM741 Ic
PDF
LM741 Ic
Mid Term Solution
PDF
Mid Term Solution
Assignment 3 Questions
PDF
Assignment 3 Questions
EM Theory 2023 - Assignment-2
PDF
EM Theory 2023 - Assignment-2
Solution Manual Balanis
PDF
Solution Manual Balanis