Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

MODULE 1:INTRODUCTION

TO MATLAB PROGRAMMING
1.1 MATLAB Basics
1.2 Arrays: Unlocking potential of MATLAB
1.3 Loops and Execution Control
1.3 MATLAB files: Scrips and Functions
1.4 Program Output and Plots

1.1 MATLAB Basics


Starting and Exiting MATLAB
We will go over starting a MATLAB session, layout of MATLAB
window, MATLAB editor, etc.

MATLAB Programming example


Nepali Captain, Paras Khadka, hits a ball with initial
velocity 35m/s and angle of . If the boundary is at a
distance of 75 m, will he score a six.

Results

Basic Data Types


MATLAB easily works with arrays

Scalars, vectors and arrays


Assigning variables
Row vs. column vectors
Arrays/Matrices

Suppress echo
Variables are case-sensitive

Basic Mathematical Expressions


Scalar Operations

+, -, *, /, ^
log, exp
power, sqrt
sin, cos, tan
asin, acos, atan
rem, round, ceil, floor

Special Variables
Variable

Meaning

pi

Number

eps
eps
ii

Machine
Machine precision
precision
Imaginary
Imaginary unit
unit

inf
NaN

Infinity
Not a number (e.g., 0/0)
Last displayed result

ans
end

Last element of array

realmax

Largest real number

intmax

Largest integer

You might also like