0% found this document useful (0 votes)
4 views

Lecture 1

Uploaded by

Souvik Saha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture 1

Uploaded by

Souvik Saha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

IT Workshop

Programming in Matlab
Lecture-1: Introduction
What is MATLAB?

MATLAB stands for Matrix Laboratory


It is a high-performance language for technical
computing.
Typical uses include:
• Math and computation
• Algorithm development
• Modeling, simulation, and prototyping
• Data analysis, exploration, and visualization
• Scientific and engineering graphics
• Application development, including Graphical User
Interface building
Language Fundamentals

• While other programming languages usually work with numbers


one at a time, MATLAB operates on whole matrices and arrays

• Here will look into basic operations, such as-


• creating variables,
• array indexing,
• arithmetic, and
• data types.
Desktop Environment
Command Window — Enter
commands at the command
line, indicated by the
prompt (>>).

Current Folder-
Saved files can be
accessed

Workspace — Explore data


that you create or import
from files.
Matrices and Arrays

All MATLAB variables are multidimensional arrays, no matter what type of


data. A matrix is a two-dimensional array often used for linear algebra.

Array Creation

To create an array with four elements in a single row,


separate the elements with either a comma (,) or a space.

a = [1 2 3 4]

This type of array is a row vector.


Matrices

To create a matrix that has multiple rows, separate the


rows with semicolons.

a = [1 2 3; 4 5 6; 7 8 10]

a=

1 2 3
4 5 6
7 8 10
Matrices

Another way to create a matrix is to use a function, such as ones,


zeros, or rand. For example, create a 5-by-1 column vector of zeros.

z = zeros(5,1)
z=

0
0
0
0
0
0.8147
rand(5,1) rand(1,5) 0.9058
0.1270
ans =
0.9134
0.6324
0.0975 0.2785 0.5469 0.9575
0.9649

You might also like