Attribution Non-Commercial (BY-NC)

24 views

Attribution Non-Commercial (BY-NC)

- Acc Geom eDay 1
- manualv2
- Csec Mathematics January 2016
- Sohcahtoa Lesson Plan
- Filter kalman vs complementary
- inquiry question for khan and maria
- Arcsine.pdf
- Metastock Fomula Language_Anh
- Migrant Education Whitepaper
- johnny yan-midterm sedc 723 f16
- Calculus
- Euler Formula
- Right triangle definitions.doc
- Book by Jaromir Kuben
- trigsyllabus07
- TRIGNO~1
- 6664_01R_msc_20130815
- FundEngiMaths_Stud2016_1
- Untitled
- ydzh04

You are on page 1of 4

Derrick Hasterok

January 27, 2005

1 Introduction

Matlab has a multitude of syntax and basic commands. Begining to program

in a new language can be a daunting task. This document is meant as a help

to make getting started with Matlab a bit easier. Listed below is a few of the

basic commands and a few of their properties. This list is not exhaustive, nor

is it meant to be. The Matlab command ’help’ is your friend!

2 System Commands

cd - Change directory.

clc - Clears command window.

clear - Clears variables from workspace.

close - Closes figures.

delete - Deletes file.

ls - Lists directry.

help - Tells you how to use a command.

mkdir - Makes directory.

pwd - Prints working directory.

who - Lists current variables on workspace.

whos - Lists current variables and size.

why - Just try it if you get annoyed.

3 Operators

3.1 Arithmetic operators

+ - Plus

- - Minus

* - Matrix multiply

.* - Array multiply

^ - Matrix power

.^ - Array power

/ - Right matrix divide

1

./ - Right array divide

== - Equal

~= - Not equal

< - Less than

> - Greater than

<= - Less than or equal

>= - Greater than or equal

& - Logical AND

| - Logical OR

~ - Logical NOT

: - Span operator [1:5] = [1 2 3 4 5]

( ) - Operation grouping

[ ] - Vector and matrix delimiter

. - Decimal point

.. - Parent directory

... - Continuation of command to next line

, - Separator

; - End line or row

% - Comment

= - Assignment operator

’ - String delimiter

.’ - Transpose

’ - Complex conjugate transpose

4 Basic Syntax

if - Conditionally execute statements.

else - IF statement condition.

elseif - IF statement condition.

end - Terminate scope of FOR, WHILE, SWITCH, TRY and IF statements.

for - Repeat statements a specific number of times.

while - Repeat statements an indefinite number of times.

break - Terminate execution of WHILE or FOR loop.

continue - Pass control to the next iteration of FOR or WHILE loop.

function - Add new function.

return - Return to invoking function.

2

error - Display error message and abort function.

disp - Display an array.

feval - Execute function specified by string.

5.1 Trigonometric

sin - Sine.

asin - Inverse sine.

cos - Cosine.

acos - Inverse cosine.

tan - Tangent.

atan - Inverse tangent.

atan2 - Four quadrant inverse tangent.

5.2 Basic

sqrt - Square root.

exp - Exponential.

log - Natural logarithm.

log10 - Common (base 10) logarithm.

factorial - Factorial function.

5.3 Complex

abs - Absolute value.

conj - Complex conjugate.

real - Complex real part.

imag - Complex imaginary part.

isreal - True for real array.

5.4 Rounding

floor - Round towards minus infinity.

ceil - Round towards plus infinity.

round - Round towards nearest integer.

mod - Modulus.

norm - Matrix or vector norm.

det - Determinant.

inv - Matrix inverse.

eig - Eigenvalues and eigenvectors.

cross - Vector cross product.

3

dot - Vector dot product.

6 File input/output

input - Prompt for user input.

load - Load workspace from MATLAB (MAT) file.

save - Save data to MATLAB (MAT) file.

7 Plot commands

7.1 2D Graphs

plot - Linear plot.

loglog - Log-log scale plot.

semilogx - Semi-log scale plot.

semilogy - Semi-log scale plot.

axis - Control axis scaling and appearance.

hold - Hold current graph.

title - Graph title.

xlabel - X-axis label.

ylabel - Y-axis label.

get - Gets plot properties.

set - Sets plot properties.

Color Line Type Marker Type

m - magenta : - dotted o - circle

c - cyan -. - dashdot x - x-mark

r - red -- - dashed + - plus

g - green * - star

b - blue s - square

w - white d - diamond

k - black v - triangle (down)

^ - triangle (up)

< - triangle (left)

> - triangle (right

p - pentagram

h - hexagram

- Acc Geom eDay 1Uploaded bymike_924
- manualv2Uploaded byHenry Hurtado
- Csec Mathematics January 2016Uploaded bynaomihg
- Sohcahtoa Lesson PlanUploaded byLoganTupper
- Filter kalman vs complementaryUploaded byDante Fajardo Olmos
- inquiry question for khan and mariaUploaded byapi-237623449
- Arcsine.pdfUploaded bySolomon Tamiru
- Metastock Fomula Language_AnhUploaded byNuri
- Migrant Education WhitepaperUploaded byJordan Brown
- johnny yan-midterm sedc 723 f16Uploaded byapi-358414245
- CalculusUploaded byCris Sosa
- Euler FormulaUploaded byMeral Meral
- Right triangle definitions.docUploaded byArki Tekture
- Book by Jaromir KubenUploaded bykothapalli21
- trigsyllabus07Uploaded byanon-579447
- TRIGNO~1Uploaded byTom Edison
- 6664_01R_msc_20130815Uploaded bySameer Ahmed
- FundEngiMaths_Stud2016_1Uploaded byTuổi Thơ Bị Bắt
- UntitledUploaded byapi-235013476
- ydzh04Uploaded bybogdan_mihai666
- PRE AssessmentUploaded bysherdan
- maths 11 yearlyUploaded byKalium19
- amp-phaseUploaded byatanozof
- LibreOffice Calc Guide 20Uploaded byVioleta Xevin
- Aptitude Test FormulaeUploaded byKriti Shah
- program_summary_HSC2U.pdfUploaded byBilly Bob
- 4 7 inverse trig functionsUploaded byapi-261956805
- Anisotropic NLUploaded byHisham Kolaly
- EX 1DOF Rot Gondola SwingingUploaded byconcord1103
- JEE Advanced 2019 Paper AnalysisUploaded byVoila habibi

- android.docUploaded byHajiram Beevi
- luxaprime 1500_5752.pdfUploaded byAbhinav Sinha
- Sessional CSC 401Uploaded byMuhammadImranIrshad
- Seeed germination rated of Santalum albumUploaded bykehicap
- XPIC.pptUploaded byRichard Pascual
- Phil Collins LyricsUploaded bytheo
- Strength of MaterialsUploaded byEkajara Josh
- Homework 1Uploaded byElizabeth Wachs
- Q Link Wireless - Issa Asad - Proposed Universal Service OfferingUploaded bybrakemeter9
- En.wikipedia.org Wiki Grapevine (Gossip)Uploaded byShakhowath Chowdhury
- Esther Peeren (auth.) - The Spectral Metaphor_ Living Ghosts and the Agency of Invisibility-Palgrave Macmillan UK (2014).pdfUploaded byDavid Pinheiro Vicente
- The Kinetics of the Esterification Reaction Between Castor OilUploaded byJúlio Militão
- Missouri's 1838 Extermination OrderUploaded byLeena Rogers
- The Difference Between DECODE and CASE — OratableUploaded byVikram Varma
- 1322715 - Unicode FAQsUploaded byrohit19agg
- Morality & Abstract ThinkingUploaded byJack Striker
- Critical P&ID ReviewUploaded bykhanasifalam
- 30 Pratt CatalogUploaded byraolyj
- Dumakanal Road 15 023 2018Uploaded byshakeeb
- Power Engineering DictionaryUploaded byBheem Naveen
- slab43-S4.pdfUploaded byR K YADAV
- Polyurea Grease Mobil Shc PolyrexUploaded bytribolas
- CHEMISTRY German-English DictionaryUploaded byannawajda
- Study ScheduleUploaded byMan Dip
- Bengali Character Recognition using feature extractionUploaded byshivua
- 08Uploaded byiunm26386
- Mosfet en UPS.pdfUploaded bycigua
- Hotel Management SystemUploaded byAjay Chander R
- Coupled Fluid Flow and Radiation Modeling of a Small Parti̇cle Solar Recei̇verUploaded bygldn1gldn
- Intro To Computing & Programming With JavaUploaded byLuis Cardenas