Arrays, Multidimensional Arrays, Operations
Arrays, Multidimensional Arrays, Operations
Expt.No.
Date:
Aim:
To understand the basic logic behind Matrices and its Operations using Matlab tool.
Softwares Required:
Matlab R2015a
Hardware Required:
% Assigning array
elements row wise to a
variable A
A personnel Computer.
Procedures:
1. Open matlab File.
2. Type the program in the editor
3. Save the file with .m
the program.
4. Verify the output in the
% Assigning array
elements row wise to a
variable B
% Adding elements in A
with B
window.
Extension and run
command Window.
Theory:
Arrays are container objects for
contrast to tables, the indices must be
integers. While tables may grow in
the number of entries in an array
fixed.
A Scalar is a (1 x 1) Matrix
element only. A column vector is an
has m number of rows but single
Row vector is an (1 x n) matrix that
columns but single row only.
A 1-dimensional array is printed as a
index corresponds to the column
A 2-dimensional array is printed as a
index corresponds to the row number
index corresponds to the column
% Subtracting elements
in A from B
% Multiplying elements
in A with B (Element by
Element)
% Dividing elements in A
with B (Element by
Element)
%Taking Transpose of B
Array Operations:
% Multiplying elements
in A with C
storing data. In
sequences
of
size dynamically,
created by array is
containing single
(m x 1) matrix that
Column only. A
has n number of
row vector.
number.
The
Array Indexing:
Appending Matrices:
Reshaping Matrices:
Deleting Matrices:
Result: