Experiment-1: Date: OBJECTIVE: 1: Creating A One and Two-Dimensional Array (Row / Column Vector)
Experiment-1: Date: OBJECTIVE: 1: Creating A One and Two-Dimensional Array (Row / Column Vector)
Experiment-1: Date: OBJECTIVE: 1: Creating A One and Two-Dimensional Array (Row / Column Vector)
DATE:
OBJECTIVE: 1: Creating a One and Two-Dimensional Array (Row / Column Vector)
(Matrix of given size) then,
(A) Performing Arithmetic Operations - Addition, Subtraction, Multiplication and
Exponentiation.
(B). Performing Matrix operations - Inverse, Transpose, Rank with plots.
SOFTWARE USED: MATLAB
PROCEDURE:
A=[1 2 3 4]
C=A-B
D=A+B
E=A*B
G=A/B
Z=A.*B
W=A./B
Q=A\B
det(A)
det(B)
transpose(A)
transpose(B)
rank(A)
rank(B)
exp(A)
exp(B)
inv(A)
inv(B)
OUTPUT:
A=
123
A=
123
456
789
B=
356
642
215
C=A-B
C=
-2 -3 -3
-2 1 4
574
D=A+B
D=
479
10 9 8
9 9 14
E=A*B
E=
21 16 25
54 46 64
87 76 103
G=A/B
G=
0.4545 -0.0909 0.0909
det(A)
ans =
det(B)
ans =
-88
transpose(A)
ans =
147
258
369
transpose(B)
ans =
362
541
625
rank(A)
ans =
rank(B)
ans =
exp(A)
ans =
1.0e+003 *
exp(B)
ans =
Z=A.*B
Z=
3 10 18
24 20 12
14 8 45
W=A./B
W=
Q=A\B
Q=
1.0e+016 *
inv(A)
ans =
1.0e+016 *
inv(B)
ans =
SIGNATURE:
Introduction to MATLAB
1.1 Introduction
1- Command Window: Use the Command Window to enter variables and run
functions and M-files.
2- Command History: Statements you enter in the Command Window are
logged in the Command History. In the Command History, you can view
previously run statements, and copy and execute selected statements.
3- Current Directory Browser: MATLAB file operations use the current
directory reference point. Any file you want to run must be in the current
directory or on the search path.
4-Workspace: The MATLAB workspace consists of the set of variables
(named arrays) built up during a MATLAB session and stored in memory.
5- Editor/Debugger Window: Use the Editor/Debugger to create and debug
M-files.
Notes: