School

York UniversityDepartment

Information TechnologyCourse Code

ITEC 2600Professor

Xiaofeng ZhouLecture

9This

**preview**shows page 1. to view the full**4 pages of the document.**TEC 2600 MatLab Chapter 1

What is MatLab

◦ Short for Matrix Laboratory, Solves any technical problems

◦ High level language, computer program for technical computing and

simulation, Numerical computation and visualization without intensive

programming knowledge

◦ For MatLab always state the letters so for example m=100

◦ NaN= Not a number

◦ Variable Names must begin with a letter followed by letters, digits. No spaces

is allowed

◦ Very case sensitive

◦ If you put a semicolon at the end of a statement it will suppress the output

◦ Spaces in statement does not affect the result

◦ help can be used to identify MatLab functions

Variables

◦ who list all variables in the current active workspace in alphabetical order

◦ who’s is information of all variable in the current active workspace in

alphabetical order

◦ clear- clears out all variables

◦ clear variable list clears out a certain variable

Expressions

◦ It can be created using values, variables, built in function

◦ format long changes the format to long

◦ format short changes the format to short

◦ format loose and format compact used to control spacing between MatLab

command/expression and result

Types

◦ Every expression or variable has a type that comes with it

◦ Float or real numbers - Single and double

◦ Integers: int8, int16, int32, and int64 they represent number of bits used to

store values of that type

◦ unsigned integer: uint8, uint16, uint32, and uint64, only be positive number

or 0

◦ Range can be found using intmin and intmax

Operators

◦ Math operators: +,_,*,^

◦ xor is true if one and only one is true

find more resources at oneclass.com

find more resources at oneclass.com

###### You're Reading a Preview

Unlock to view full version