




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This lecture notes was distributed for Machine Learning course by Pakistan Institute of Engineering and Applied Sciences, Islamabad (PIEAS). Its main points are: MATLAB, Matrices, Vectors, Variables, Subscript, Notation, Colon, Complex, Numbers, Strings, Polynomials
Typology: Exercises
1 / 110
This page cannot be seen from the preview
Don't miss anything!





























































































Dr. Hanif Durad
Dr. Hanif Durad
Complex numbers Strings Polynomials
Some basic linear algebra Vectorized operations Array operators
Dr. Hanif Durad
Dr. Hanif Durad
Dr. Hanif Durad
^ Many standard mathematical functions, such as sin, cos, log, andlog10, are built-in>> log(256)
log(x) computes the natural logarithm of x
ans =5.5452>> log10(256)
log10(x) is the base 10 logarithm
ans =2.4082>> log2(256)
log2(x) is the base 2 logarithm
ans = 8
Dr. Hanif Durad
^ The help browser opens when you type a doc command:>> doc plot
Dr. Hanif Durad
Inverse cosine. ACOSH
Inverse hyperbolic cosine. COS
Cosine. COSH
Hyperbolic cosine.
Dr. Hanif Durad
Dr. Hanif Durad
^ Type variable name and omit the semicolon to print the value ofa variable (that is already defined)>> x = 5;>> y = sqrt(59);>> z = log(y) + x^0.25z =3.5341>> yy =7.
( = log(sqrt(59)) + 5^0.25 ) Suppress Output with Semicolon(2/2)
Begin with one of a–z or A–Z Have remaining characters chosen from a–z, A–Z, 0–9, or Have a maximum length of 31 characters Should not be the name of a built-in variable, built-in function, or user-defined function
xxxxxxxxx pipeRadius widgets_per_box mySum mysum
^ Note: mySum and mysum are differentvariables. MATLAB is case sensitive.
Dr. Hanif Durad
Name
Meaning ans^
value of an expression when that expression is not assignedto a variable eps^
floating point precision pi^
π, (3.141492.. .) realmax
largest positive floating point number realmin
smallest positive floating point number Inf^
∞, a number larger than realmax, the result of evaluating 1/0. NaN^
not a number, the result of evaluating 0/