Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
156 views

Matlab Manual

The document provides an overview of MATLAB fundamentals and covers topics such as the typical MATLAB environment, MATLAB mathematical functions, arrays and matrices, matrix operations, and logical operators. It also includes laboratory exercises for students to practice creating matrices and performing basic operations in MATLAB.

Uploaded by

sm8216415
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views

Matlab Manual

The document provides an overview of MATLAB fundamentals and covers topics such as the typical MATLAB environment, MATLAB mathematical functions, arrays and matrices, matrix operations, and logical operators. It also includes laboratory exercises for students to practice creating matrices and performing basic operations in MATLAB.

Uploaded by

sm8216415
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Matlab laboratory manual for Engineering Mathematics-I

SIDDAGANGA INSTITUTE OF TECHNOLOGY, TUMAKAUR – 572 103


DEPARTMENT OF MATHEMATICS

LABORATORY MANUAL
FOR
MATLAB: MATHEMATICS-I for ENGINEERS

Coordinators:

Dr. M. Siddalinga Prasad


Associate Professor
Department of Mathematics
SIT, Tumakuru- 572 103

&

Dr. Basavaraj Ittanagi


Assistant Professor
Department of Mathematics
SIT, Tumakuru- 572 103

Department of Mathematics, SIT, Tumakuru 1


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Table of Contents

Sl. PROGRAMS Page No.


No.

1 Laboratory - 0
3
MATLAB FUNDAMENTALS

2 Laboratory - 1
8
CARTESIAN AND POLAR PLOTS

3 Laboratory - 2

ANGLE BETWEEN TWO POLAR CURVES, RADIUS OF CURVATURE 20


AND CURVATURE

4 Laboratory – 3
27
PARTIAL DERIVATIVES AND JACOBIAN

5 Laboratory - 4
36
FINDING EXTREME VALUES FOR A FUNCTION OF TWO VARIABLES

6 Laboratory - 5
44
CONSISTENCY OF SYSTEM OF LINEAR EQUATIONS

7 Laboratory – 6

GAUSS SEIDEL METHOD TO SOLVE A SYSTEM OF LINEAR 49


EQUATIONS

8 Laboratory – 7
52
EIGNE VALUE AND EIGEN VECTOR

9 Laboratory – 8

SOLUTION OF FIRST ORDER ORDINARY DIFFERENTIAL 54


EQUATIONS

10 Laboratory – 9
60
EUCLID'S ALGORITHM

11 Laboratory – 10
62
BETA AND GAMMA FUNCTIONS

Department of Mathematics, SIT, Tumakuru 2


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 0

MATLAB FUNDAMENTALS

Matlab stands for Matrix Laboratory.

Matlab is a high performance language for technical computing. Matlab is an interactive system
whose data element is an array that does not require dimensioning.

It integrates computation, visualization and programming in an easy to use environment where


problems and solutions are expressed in mathematical notations.

Applications of Matlab include


i) Math and Computation
ii) Algorithm development
iii) Modeling, Simulation and Prototyping
iv) Data analysis, exploration and visualization
v) Scientific and Engineering graphics
vi) Application development

Matlab features a family of application specific solution called toolboxes. Toolboxes allow us to learn
and apply specialized technology. Toolboxes are comprehensive collection of Matlab functions (M
files) that extend the Mablab environment to solve particular class of problems. Areas in which toll
boxes are available include Fuzzy logic, Neural Networks, Signal Processing, Control Systems,
Wavelets, Simulation and many more.

Matlab System consists of five parts, namely


1) Development Environment: It includes Matlab desktop, command window, a command
history, a help browser, the workspace, files and search path.
2) Matlab Mathematical function library: It consists of all mathematical functions like sin, cos,
log, ............................. till fast Fourier Transform
3) The Matlab Language: This is a high level matrix / array language with control flow
statements, functions, data structures, input/output and so on. It allows us to write programs
to perform the defined task.
4) Handle Graphics: Tool for visualization, image processing, animations, presentations of
graphics.
5) Matlab Application:

Department of Mathematics, SIT, Tumakuru 3


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

The typical Matlab environment is as shown below.

Command window - opens with a command prompt in the beginning.


Calculator mode operates in a sequential way
Default output variable name is “ans”.

Assignment:

Scalars - >> a = 4 (takes the value of a as 4 and display a = 4)


>> a = 4; (takes the value of a as 4 and supresses the output)
>> b = 4 + i*2 or b = 4 +j*2 assigning a complex number
(in the output only i displays)

Exercise:

Perform all the arithmetic operations with the complex numbers.

Department of Mathematics, SIT, Tumakuru 4


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Library functions
clc – clear the screen

clear – clear all the variables used so far in the command window
help NAME - Display help text in Command Window
(If NAME is not specified, help displays content relevant to your previous actions.)

who - lists the variables in the current workspace

sqrt(),
sin(), cos(), tan(), : Trigonometric functions in radians
sind(), cosd(), tand(), : Trigonometric functions in degrees
exp(), sinh(), cosh(), : Exponential or hypergeometric functions
log(), log10(), log2(), : Logarithmic functions
asin(), acos(), atan() : Inverse Trigonometric functions

Arrays: Collection of values represented by single value name.


Examples:
A=[1 2 3 4 5 6] or A=[1,2,3,4,5,6] a row matrix

B=[1; 2; 3; 4; 5; 6]
or
B=[1
2
3 a column matrix
4
5
6]

C=[1; 2; 3; 4; 5; 6]’ transposed matrix

D=[1 2 3;4 5 6] an array of size 2 x 3

Z=[0 0 0;0 0 0;0 0 0] a zero matrix of size 3 x 3

Z can also be generated by a command zeros(m,n)

U=[1 1 1; 1 1 1; 1 1 1] a unity matrix of size 3 x 3


U can also be generated by a command ones(m,n)

I=[1 0;0 1] or I=[1 0 0;0 1 0;0 0 1] Identity matrix of size 2 or 3.


I can also be generated by a command eye(n)

Department of Mathematics, SIT, Tumakuru 5


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Colon (:) operator


It is used to generate a vector with the uniform spacing between the points

Syntax
<variable name> = a : n : b
where a is the initial value, n is the increment/decrement (default is 1), b is the final value

Example:
1) X=1:10
X=
1 2 3 4 5 6 7 8 9 10
2) Y=10:-1:1
Y=
10 9 8 7 6 5 4 3 2 1
3) Z=3.5:0.25:5.75
Z=
3.5000 3.7500 4.0000 4.2500 4.5000 4.7500 5.0000 5.2500 5.5000 5.7500
4) Z=3.5:0.25:5.7
Z=
3.5000 3.7500 4.0000 4.2500 4.5000 4.7500 5.0000 5.2500 5.5000

linspace
linspace Linearly spaced vector.
Syntax
linspace(X1, X2)
generates a row vector of 100 linearly equally spaced points between X1 & X2.
linspace(X1, X2, N)
generates N points between X1 and X2.
Note: for N = 1, linspace returns X2.

Examples:
Generate vectors X,Y,Z using linspace command
X=1:10  linspace(1,10,10)
Y=10:-1:1  linspace(10,1,10)
Z=3.5:0.25:5.75  linspace(3.5,5.75,10)

Department of Mathematics, SIT, Tumakuru 6


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Matrix Operations:
Operator Function Command
+ Addition A+B
- Subtraction A-B
* Multiplication A*B
/ Division A/B (computes A*B-1 )
.* Element by element multiplication A.*B
./ Element by element division A./B
inv Inverse of a non-singular matrix inv(A)

Logical operators
Symbol Meaning
== Equal
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
~= Not equal to

Laboratory Exercises

1) Create an identity matrix of size 4.

2) Create zero matrix of order 3x4. Also, transpose the same.

3) Create two matrices A and B of same size and perform the above operations.

4) Multiply an identity matrix with A and verify A*I=I*A=A.

5) Compute the inverse of matrix A. Verify that A*A-1=A-1*A=I.

6) Let P be a matrix of size 5x6. Extract the elements of


i) First row
ii) First column
iii) Second row 3rd to 6th elements
iv) Second column 3rd to 5th elements.

Department of Mathematics, SIT, Tumakuru 7


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 1

CARTESIAN AND POLAR PLOTS

Aim: To plot standard Cartesian curves in xy-plane (2D plots) and polar curves in r-plane.

Matlab commands: syms, plot, fplot, fimplicit, polarplot

Syntax: syms Short-cut for constructing symbolic variables.

syms arg1 arg2 ...

plot – creates 2D plot

plot(X,Y) plots vector Y versus vector X

fplot Plot 2-D function

fplot(FUN) plots the function FUN between the limits of the current axes, with a default of [-5 5].

fplot(FUN,LIMS)

fimplicit Plot implicit function

fimplicit(FUN) plots the curves where FUN(X,Y)==0 between the axes limits,
with a default range of [-5 5].

fimplicit(FUN,LIMS) uses the given limits. LIMS can be [XMIN XMAX YMIN YMAX]

polarplot Polar plot.

polarplot(TH,R) plots vector TH vs R. The values in TH are in radians

Department of Mathematics, SIT, Tumakuru 8


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Task is to plot a straight line

syms x y
m=2;
c=1;
fimplicit(y == m*x + c)

Department of Mathematics, SIT, Tumakuru 9


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Task is to plot a circle of radius 1 and 2

syms x y
fimplicit(x^2 + y^2 == 1)
hold on
fimplicit(x^2 + y^2 == 4,'r')
hold off

Department of Mathematics, SIT, Tumakuru 10


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Task is to plot family of parabolas and mark the points of intersection.

syms x y
a=[1 2 3 4 5];
fimplicit(y^2 - 4*a*x == 0,[-20,20])
hold on
fimplicit(x^2 - 4*a*y == 0,[-20,20])
hold off

Department of Mathematics, SIT, Tumakuru 11


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Task is to plot an ellipse

syms x y
for a=[4 6 8];
b=2;
fimplicit((x/a)^2 + (y/b)^2 == 1,[-a,a])
hold on
end
hold off

Department of Mathematics, SIT, Tumakuru 12


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Task is to plot an hyperbola

syms x y
for b=[1 2 3];
a=2;
fimplicit((x/a)^2 - (y/b)^2 == 1)
hold on
end
hold off

Department of Mathematics, SIT, Tumakuru 13


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

polar plot - Cardior

th=0:0.01:2*pi;
a=2;
r=a*(1+cos(th));
polarplot(th,r)
title('Cardiod')

Department of Mathematics, SIT, Tumakuru 14


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Plot the 4 petal rose r = cos2θ

th=0:0.01:2*pi;
a=2;
r=cos(2*th);
polarplot(th,r)
title('4 Leaved Rose')
plotedit off

Department of Mathematics, SIT, Tumakuru 15


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Intersection of two Cardiods

th=0:0.01:2*pi;
a=2;
r=a*(1+cos(th));
polarplot(th,r)
hold on
r=a*(1-cos(th));
polarplot(th,r)
hold off

Department of Mathematics, SIT, Tumakuru 16


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Plot rectangular hyperbola xy=c

syms x y
for c=[1 2 3];
fimplicit(x*y == c)
hold on
end
hold off

Department of Mathematics, SIT, Tumakuru 17


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Plot the curve


syms x y
for a=[1 2 3];
fimplicit(x*y^2 == a^2*(a-x))
hold on
end
hold off

Assignment:
1) Plot a parabola and a straight line in xy-plane. Locate the points of intersection.
2) Draw a 6-leaved rose.

Department of Mathematics, SIT, Tumakuru 18


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Assignment:
1) Plot a parabola and a straight line in xy-plane. Locate the points of intersection.

%Plot the curve


syms x y
a=3;
fimplicit(y^2 == 4*a*x)
hold on
fimplicit(y == a*x)
hold off

2) Draw a 6-leaved rose.

Cannot be plotted.

Department of Mathematics, SIT, Tumakuru 19


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 2

ANGLE BETWEEN TWO POLAR CURVES, RADIUS OF CURVATURE AND CURVATURE

Aim: To find i) the angle between two polar curves

ii) the radius of curvature of Cartesian and polar curves

iii) the curvature.

Formulae:
1) Angle between two polar curves=

2) Radius of curvature in Cartesian form is .

3) Radius of curvature in polar form is .

4) Curvature = reciprocal of radius of curvature.

Matlab commands: solve, subs, abs, diff

diff computes the derivative.

Df = diff(f,var,n) computes the nth derivative of f with respect to var.

Solve - Symbolic solution of algebraic equations.

S = solve(eqn1,eqn2,...,eqnM,var1,var2,...,varN)

subs - Symbolic substitution. Also used to evaluate expressions numerically.

subs(S,OLD,NEW) replaces OLD with NEW in the symbolic expression S.

abs Absolute value.

abs(X) is the absolute value of the elements of X.

Department of Mathematics, SIT, Tumakuru 20


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

1. Find the angle between two polar curves and . Hence show
graphically the point of intersection.

syms r1 th r2 a
r1=a*(1-sin(th));
ph1=r1/diff(r1);
r2=a*(1+sin(th));
ph2=r2/diff(r2);
it=solve(r1-r2==0,th);
% simplify(ph1*ph2) % to show product of slope as -1
Ang=abs(atan(ph1)-atan(ph2));
subs(Ang,it)

ans =

To plot these polar curves to identify the point of intersection

clear
a=1;
t=0:0.1:2*pi;
r1=a*(1-sin(t));
polarplot(t,r1)
hold on
r2=a*(1+sin(t));
polarplot(t,r2)
hold off

Department of Mathematics, SIT, Tumakuru 21


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

2. Find the angle between two polar curves and .

clear
syms r1 th r2 a
r1=a*exp(th);
ph1=r1/diff(r1);
r2=a*exp(-th);
ph2=r2/diff(r2);
it=solve(r1-r2==0,th);
Ang=abs(atan(ph1)-atan(ph2));
subs(Ang,it)

ans =

Plotting exercise

clear
a=1;b=1;
t=-pi:0.1:pi;
r1=a*exp(-t);
polarplot(t,r1)
hold on
r2=b*exp(-t);
polarplot(t,r2)
hold off

Department of Mathematics, SIT, Tumakuru 22


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

3. Find the angle between two polar curves and

syms r1 th r2
r1=3*cos(th);
ph1=r1/diff(r1);
r2=1+cos(th);
ph2=r2/diff(r2);
it=solve(r1-r2==0,th);
Ang=abs(atan(ph1)-atan(ph2));
subs(Ang,it)

ans =

Plotting exercise

clear
syms r1 th r2
th=0:0.1:2*pi;
r1=3*cos(th);
polarplot(th,r1);
hold on
r2=1+cos(th);
polarplot(th,r2);
hold off

Department of Mathematics, SIT, Tumakuru 23


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

4. Find the radius of curvature of y=4sinx-sin2x at .

clear
syms x y
y=4*sin(x)-sin(2*x);
d1=diff(y,1);
d2=diff(y,2);
rc=(1+d1^2)^(3/2)/d2;
rcv=abs(subs(rc,{x},{pi/2}))

rcv =

Department of Mathematics, SIT, Tumakuru 24


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

5. Find the radius of curvature of at .

clear
syms x y a b c
y=a*x^2+b*x+c;
d1=diff(y,1);
d2=diff(y,2);
rc=(1+d1^2)^(3/2)/d2;
rcv=subs(rc,{x},{(sqrt(a^2-1)-b)/(2*a)})

rcv =

6. Find the radius of curvature (0,a) for the catenary .

clear
syms x y a
y=a*cosh(x/a);
d1=diff(y,1);
d2=diff(y,2);
rc=(1+d1^2)^(3/2)/d2;
rcv=subs(rc,{x},{a})

rcv =

vpa(rcv)

ans =

7. Find the radius of curvature (a,0) for the curve .

clear
syms x y a
y=x^3*(x-a);
d1=diff(y,1);
d2=diff(y,2);
rc=(1+d1^2)^(3/2)/d2;
rcv=subs(rc,{x},{a})

rcv =

Department of Mathematics, SIT, Tumakuru 25


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

8. Show that radius of curvature for varies as using polar form of the formula.

clear
syms r th a
r=a*(1-cos(th));
r1=diff(r,th);
r2=diff(r,th,2);
rc=(r^2+r1^2)^(3/2)/(r^2+2*r1^2-r*r2)

ans =

Assignment:

Compute the curvature of the above Cartesian and polar curves.

Department of Mathematics, SIT, Tumakuru 26


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 3

PARTIAL DERIVATIVES AND JACOBIAN

Aim: To find i) the partial derivatives


ii) Jacobian using the partial derivatives
iii) Jacobian using the built-in function
iv) Visualization of Jacobian.
.

Formulae:
f
1)  Differentiate f w.r.t x by treating all other independent variables as constant
x
𝜕𝑢 𝜕𝑢
𝜕(𝑢,𝑣) 𝜕𝑥
2) Jacobian of (u,v) w.r.t (x,y) is 𝐽 = =[ 𝜕𝑦
]
𝜕(𝑥,𝑦) 𝜕𝑣 𝜕𝑣
𝜕𝑥 𝜕𝑦
2 f 2 f
Note : 1) and are called mixed derivatives and are equal.
xy yx
2) Jacobian is a consequence of geometric distortion due to transformation

Matlab commands: diff, simplify, disp, if, fimplicit3, jacobian

diff - computes the derivative

Df = diff(f,var,n) computes the nth partial derivative of f with respect to var.

simplify - Algebraic simplification

S = simplify(expr) performs algebraic simplification of expr.

If expr is a symbolic vector or matrix, this function simplifies each element of expr

disp - Display array

disp(X) displays array X

If X is a string or character array, the text is displayed

if - Conditionally execute statements

if expression
statements
ELSEIF expression
statements
ELSE
statements
END

Department of Mathematics, SIT, Tumakuru 27


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

fimplicit3 Plot implicit surface

fimplicit3(FUN) plots the surface where FUN(X,Y,Z)==0 between the axes limits,
with a default range of [-5 5].

jacobian Jacobian matrix.

jacobian(f,x) computes the Jacobian of the scalar or vector f with respect to the vector x.

Activities

1. Find all possible partial derivatives up to second order for the function f(x,y)=xy
2. Find all possible partial derivatives up to second order for f(x,y,z)=xyz
3. If then show that .

4. If then show that

5. If u=log(tanx+tany+tanz) then show that

6. If then show that

7. Find the Jacobian of and


8. Find the Jacobian of and
9. Find the Jacobian of and
10. Find the Jacobian of , and

Assignment

Compute the Jacobian using built-in function and vice versa for the problem Nos.7 to 10.

Department of Mathematics, SIT, Tumakuru 28


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Find all possible partial derivatives up to second order for the function f(x,y)=xy

clear
syms x y f
f=x*y
dfx=diff(f)
dfy=diff(f,y)
dfxx=diff(f,2) % dfxx=diff(diff(f),x)
dfxy=diff(dfx,y)
dfyx=diff(dfy,x)
dfyy=diff(dfy,y)

f = dfx = y dfy = x dfxx = 0 dfxy = 1


dfyx = 1 dfyy = 0

Find all possible partial derivatives up to second order for f(x,y,z)=xyz

clear
syms x y z f(x,y,z)
f=x*y*z
dfx=diff(f)
dfy=diff(f,y)
dfz=diff(f,z)
dfxx=diff(f,2) % dfxx=diff(diff(f),x)
dfxy=diff(dfx,y)
dfxz=diff(dfx,z)
dfyx=diff(dfy,x)
dfyy=diff(dfy,y)
dfyz=diff(dfy,z)
dfzx=diff(dfz,x)
dfzy=diff(dfz,y)
dfzz=diff(dfz,z)

f = dfx = dfy = dfz =


dfxx = 0 dfxy = z dfxz = y dfyx = z
dfyy = 0 dfyz = x dfzx = y dfzy = x
dfzz = 0

Department of Mathematics, SIT, Tumakuru 29


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

If then show that

clear
syms x y u
u=x^2*atan(y/x)-y^2*atan(x/y)
dux=diff(u);
dfxyL=diff(dux,y);
dfxy=simplify(dfxyL)

u =

dfxy =

If then show that

clear
syms x y u
u=x^y
dux=diff(u);
dfxy=diff(dux,y);
dfxyL=simplify(dfxy)
duy=diff(u,y);
dfyx=diff(duy,x);
dfxyR=simplify(dfyx)
if (dfxyL==dfxyR)
disp('Mixed Derivatives are Equal')
end

u =
dfxyL = dfxyR =

Mixed Derivatives are Equal

Department of Mathematics, SIT, Tumakuru 30


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

If u=log(tanx+tany+tanz) then show that

clear
syms x y z u
u=log(tan(x)+tan(y)+tan(z))
ux=diff(u,x)
uy=diff(u,y)
uz=diff(u,z)
LHS=sin(2*x)*ux+sin(2*y)*uy+sin(2*z)*uz
simplify(LHS)

u =
ux = uy = uz =

LHS =

ans =2

If then show that

clear
syms x y Z
Z=(x^2+y^2)/(x+y)
ux=diff(Z)
uy=diff(Z,y)
LHS=(ux-uy)^2
RHS=4*(1-ux-uy)
LHS1=simplify(LHS)
RHS1=simplify(RHS)
if (LHS1==RHS1)
disp('Given relation is true')
end

Z =

ux = uy =

LHS = RHS =

LHS1 = RHS1 =

Given relation is true

Department of Mathematics, SIT, Tumakuru 31


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Find the Jacobian of and

syms x y r th
x=r*cos(th);
y=r*sin(th);
J=[diff(x,r) diff(x,th);diff(y,r) diff(y,th)];
J1=simplify(det(J));
fimplicit3(x)
fimplicit3(y)
fimplicit3(J)

J1 = r

Department of Mathematics, SIT, Tumakuru 32


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Find the Jacobian of and

clear
syms x y u v
u=x*sin(y);
v=y*sin(x);
J=[diff(u,x) diff(u,y);diff(v,x) diff(v,y)];
J1=simplify(det(J))
fimplicit3(x)
fimplicit3(y)
fimplicit3(J)

J1 =

Department of Mathematics, SIT, Tumakuru 33


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Find the Jacobian of and

clear
syms x y u v
x=u^2-v^2;
y=2*u*v;
J=[diff(x,u) diff(x,v);diff(y,u) diff(y,v)];
J1=simplify(det(J))
fimplicit3(x)
fimplicit3(y)
fimplicit3(J)

J1 =

Department of Mathematics, SIT, Tumakuru 34


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Find the Jacobian of , and

clear
syms x y z u v w
u=5*y;
v=4*x^2-2*sin(y*z);
w=y*z;
fimplicit3(u)
fimplicit3(v)
fimplicit3(w)
J=jacobian([u;v;w],[x y z])
fimplicit3(J)

J =

Department of Mathematics, SIT, Tumakuru 35


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 4

FINDING EXTREME VALUES FOR A FUNCTION OF TWO VARIABLES

Aim: To find the extreme values of the function of two variables i.e. to find the maximum or
minimum value of the function f(x,y).

Procedure: Procedure to find extreme values

1) Compute the partial derivatives of f w.r.t. x and y

2) Solve for x and y called critical points

3) Compute the partial derivatives of second order

4) Test the following conditions and hence draw the conclusion

a) If then f has maximum at (x,y)

b) If then f has minimum at (x,y)

c) If then f has saddle points at (x,y)

d) If then procedure is insufficient to find the nature.

Matlab commands: vpasolve, fsurf, fprintf, for

Syntax: vpasolve - Numerical solution of algebraic equations.

vpasolve([eq1,...,eqn],[x1,...,xm])

Solve the system of equations eq1,...,eqn in the variables x1,...,xm

fsurf - Plot 3-D surface

fsurf(FUN) creates a surface plot of the function FUN(X,Y).

FUN is plotted over the axes size, with a default interval of -5 < X < 5, -5 < Y < 5.

Department of Mathematics, SIT, Tumakuru 36


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

fprintf - Write formatted data to text file

fprintf(FORMAT, A, ...) formats data and displays the results on the screen.

for - Repeat statements a specific number of times

for variable = expr, statement, ..., statement END

Activities

1. Find the extreme values of

2. Find the extreme values of

3. Find the extreme values of , where a=1

Department of Mathematics, SIT, Tumakuru 37


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

1. Find the extreme values of

clear
syms x y
f=x^3+y^3-3*x-12*y+20
fx = diff(f,x);
fy = diff(f,y);
S = vpasolve([fx==0, fy==0],[x y]);
ml = [S.x S.y];
sf=fsurf(f);
xsy=size(ml);
ed=xsy(:,1);

for i=1:ed
fprintf('Critical Points are ( %d, %d ) \n',ml(i,:))
end

for i=1:ed
A=diff(fx,x);
AV=subs(A,{x y},{ml(i,:)});
B=diff(fx,y);
C=diff(fy,y);
Con=A*C-B^2;
ConV=subs(Con,{x y},{ml(i,:)});
fV=subs(f,{x y},{ml(i,:)});
if (ConV>0 & AV<0)
fprintf('Maximum at ( %d, %d ) and Max. Value= %d \n',ml(i,:),fV)
elseif (ConV>0 & AV>0)
fprintf('Minimum at ( %d, %d ) and Min. Value= %d \n',ml(i,:),fV)
elseif (ConV<0)
fprintf('Saddle Point at ( %d, %d ) \n',ml(i,:))
else
fprintf('Fuurther Investigation required at ( %f, %f) \n',ml(i,:))
end
end

Department of Mathematics, SIT, Tumakuru 38


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

D =

Critical Points are (-1,-2)


Critical Points are (1,-2)
Critical Points are (-1,2)
Critical Points are (1,2)

Maximum at ( -1, -2 ) and Max. Value= 38


Saddle Point at ( 1, -2 )
Saddle Point at ( -1, 2 )
Minimum at ( 1, 2 ) and Min. Value= 2

Department of Mathematics, SIT, Tumakuru 39


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

2. Find the extreme values of

clear
syms x y
f=2*x*y-5*x^2-2*y^2+4*x+4*y-6
fx = diff(f,x);
fy = diff(f,y);
S = vpasolve([fx==0, fy==0],[x y]);
fsurf(f)
ml = [S.x S.y];

xsy=size(ml);
ed=xsy(:,1);

for i=1:ed
fprintf('Critical Points are ( %f, %f ) \n',ml(i,:))
end

for i=1:ed
A=diff(fx,x);
AV=subs(A,{x y},{ml(i,:)});
B=diff(fx,y);
C=diff(fy,y);
Con=A*C-B^2;
ConV=subs(Con,{x y},{ml(i,:)});
fV=subs(f,{x y},{ml(i,:)});
if (ConV>0 & AV<0)
fprintf('Maximum at ( %f, %f) and Max. Value= %f \n',ml(i,:),fV)
elseif (ConV>0 & AV>0)
fprintf('Minimum at ( %f, %f) and Min. Value= %f \n',ml(i,:),fV)
elseif (ConV<0)
fprintf('Saddle Point at ( %f, %f) \n',ml(i,:))
else
fprintf('Fuurther Investigation required at ( %f, %f) \n',ml(i,:))
end
end

Department of Mathematics, SIT, Tumakuru 40


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

D =

Critical Points are ( 0.6666674, 1.3333334)

Maximum at ( 0.666667, 1.333333) and Max. Value= -2.000000

Department of Mathematics, SIT, Tumakuru 41


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

3. Find the extreme values of , where a=1

clear
syms x y a
a=1;
f=x^3+y^3-3*a*x*y
fx = diff(f,x);
fy = diff(f,y);
S = vpasolve([fx==0, fy==0],[x y]);
ml = [S.x S.y];
fprintf('Critical Points are ( %f, %f) \n',ml(1,:))
fprintf('Critical Points are ( %f, %f) \n',ml(4,:))
xsy=size(ml);
ed=xsy(:,1);
fsurf(f)
for i=[1 ed]
A=diff(fx,x);
AV=subs(A,{x y},{ml(i,:)});
B=diff(fx,y);
C=diff(fy,y);
Con=A*C-B^2;
ConV=subs(Con,{x y},{ml(i,:)});
fV=subs(f,{x y},{ml(i,:)});
if (ConV>0 & AV<0)
fprintf('Maximum at ( %f, %f) and Max. Value= %f \n',ml(i,:),fV)
elseif (ConV>0 & AV>0)
fprintf('Minimum at ( %f, %f) and Min. Value= %f \n',ml(i,:),fV)
elseif (ConV<0)
fprintf('Saddle Point at ( %f, %f) \n',ml(i,:))
else
fprintf('Fuurther Investigation required at ( %f, %f) \n',ml(i,:))

end
end

Department of Mathematics, SIT, Tumakuru 42


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

D =

Critical Points are ( 0.000000, 0.000000)

Critical Points are ( 1.000000, 1.000000)

Saddle Point at ( 0.000000, 0.000000)

Minimum at ( 1.000000, 1.000000) and Min. Value= -1.000000

Department of Mathematics, SIT, Tumakuru 43


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 5

CONSISTENCY OF SYSTEM OF LINEAR EQUATIONS

Aim: To test whether the system of linear equations is consistent or not and hence to solve.

Procedure: 1) Construct the augmented matrix by appending the column matrix b into A i.e.[A:b]

2) Find the rank of A and [A:b]. If ranks are equal then declare system as
“Consistent” otherwise “Inconsistent”

3) When system is consistent

– it will have unique solution if rank of A = rank of [A:b] = number of unknowns

– it will have infinite solutions if rank of A = rank of [A:b] < number of unknowns

4) Solve the system of equations using “solve” command.

Matlab commands: input, rank

Syntax: input - Prompt for user input.

RESULT = input(PROMPT)

displays the PROMPT string on the screen, waits for input from the keyboard, evaluates any
expressions in the input and returns the value in RESULT.

rank - Matrix rank.

rank(A)

provides an estimate of the number of linearly independent rows or columns of a matrix A

Activities

Test for consistency and hence solve the following systems.

1) 2) 3)

Department of Mathematics, SIT, Tumakuru 44


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Program to test the consistency of a system and hence to solve

clear

A=input('Enter the Coefficient Matrix')


b=input('Enter the RHS Matrix')

% Construct the augmented marix Ag


Ag=[A b];
% Find the rank of coefficient matrix A and augmented marix Ag
ra=rank(A);
rg=rank(Ag);

syms x y z
D=[x; y; z];
F=A*D;
SS=F==b

if (ra==rg)
disp('System is consistent')
sz=size(A);
S=solve([SS],{x y z});
if (ra==sz(end))
disp('System has Unique solution and is')
else
disp('System has infinite solutions and one particular solution
is')
end
disp(S)
else
disp('System is Inconsistent')
end
% To visualization of planes
fimplicit3(SS)

Department of Mathematics, SIT, Tumakuru 45


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

1.

Enter the Coefficient Matrix[2 3 5;7 3 -2;2 3 5]


Enter the RHS Matrix[9;8;1]

System is Inconsistent

Department of Mathematics, SIT, Tumakuru 46


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

2.

Enter the Coefficient Matrix[5 3 7;3 26 2;7 2 10]


Enter the RHS Matrix[4 9 5]’

System is consistent

System has infinite solutions and one particular solution is


x: 7/11
y: 3/11
z: 0

Department of Mathematics, SIT, Tumakuru 47


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

3.

Enter the Coefficient Matrix[27 6 -1;6 15 2;1 1 54]


Enter the RHS Matrix[85 72 110]’

System is consistent

System has Unique solution and is

x: 48250/19893
y: 71078/19893
z: 12771/6631

Department of Mathematics, SIT, Tumakuru 48


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 6

GAUSS SEIDEL METHOD TO SOLVE A SYSTEM OF LINEAR EQUATIONS

Aim: To solve a system of linear equations using Gauss-Seidel method.

Given the system

Working Rule:
Step1: Rewrite the above equations as follows:

(1)

(2)

(3)

Step2: Choose the initial approximation to the solution as 0; 0; 0.

Step3: (i) Compute using the values of and from equation (1)

(ii) Compute using the values of obtained in step 3(i) and from equation (2)

(iii) Compute using the values of and obtained in step 3(i) and (ii) from equation (3)

Step4: Repeat the above procedure for the specified number of times

Activities

Solve the following systems using Gauss-Seidel Method.

1) 2) 3)

Department of Mathematics, SIT, Tumakuru 49


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

% program to solve a system of liner equations using Gauss-Seidel Method


a=input('Enter the Coefficient Matrix a:')
b=input('Enter the RHS Matrix b:')

itr=input('Enter the number of iterations: ')


x1=0;x2=0;x3=0;
for i=1:itr
x1=[b(1,1)-a(1,2)*x2-a(1,3)*x3]/a(1,1);
x2=[b(2,1)-a(2,1)*x1-a(2,3)*x3]/a(2,2);
x3=[b(3,1)-a(3,1)*x1-a(3,2)*x2]/a(3,3);
fprintf('Iteration=%d\n',i)
fprintf('x1=%f, x2=%f,x3=%f \n',x1,x2,x3)
end

Department of Mathematics, SIT, Tumakuru 50


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Iteration=1
x1=1.200000, x2=1.060000,x3=0.948000
Iteration=2
x1=0.999200, x2=1.005360,x3=0.999088
Iteration=3
x1=0.999555, x2=1.000180,x3=1.000053
Iteration=4
x1=0.999977, x2=0.999999,x3=1.000005

Iteration=1
x1=1.800000, x2=1.160000,x3=-0.968000
Iteration=2
x1=2.032000, x2=1.012800,x3=-0.997440
Iteration=3
x1=2.002560, x2=1.001024,x3=-0.999795
Iteration=4
x1=2.000205, x2=1.000082,x3=-0.999984

Iteration=1
x1=3.148148, x2=3.540741,x3=1.913169
Iteration=2
x1=2.432175, x2=3.572041,x3=1.925848
Iteration=3
x1=2.425689, x2=3.572945,x3=1.925951
Iteration=4
x1=2.425492, x2=3.573010,x3=1.925954

Department of Mathematics, SIT, Tumakuru 51


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 7

EIGNE VALUE AND EIGEN VECTOR

Aim: To find the eigen value and the corresponding eigen vector by power method

Given the square matrix A.

Let  be a real or complex number and X be a non-zero column vector which satisfies the relation
AX=X then  is the eigen value and X is the corresponding eigen vector.

WORKING RULE FOR POWER METHOD:


1) Let us choose X=[1 1 1]T as the initial guess for the eigen vector.

2) Compute AX and rewrite by taking the numerically largest value as common,

to get AX= X1, where  is the eigen value and X1 is corresponding eigne vector

3) Repeat step-2 for n times.

Activities

Using power method find the dominant eigne value and the corresponding eigne vector

9 1 4 10 1 1 5 −1 0 27 6 −1
1) [1 6 4] 2) [ 2 10 1 ] 3) [1 −5 1 ] 4) [ 6 15 2 ]
1 1 8 2 2 10 0 1 −5 1 1 54

Department of Mathematics, SIT, Tumakuru 52


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

clc
A=[9 1 4;1 6 1;1 1 8]
X=ones(3,1);
n=input('ENTER THE NUMBER OF ITERATIONS:\')
for i=1:n
Xn=A*X;
EVal=max(abs(Xn));
EVct=Xn/EVal;
X=EVct;
end

fprintf('Eigen Value is %f \n \n Corresponding Eigen Vector is',EVal)


disp(X)
[V,D]=eig(A)

A = 3×3
9 1 4
1 6 1
1 1 8

n = 7

Eigen Value is 11.079731

Corresponding Eigen Vector is

1.0000
0.2890
0.4393

V = 3×3 complex
0.8890 + 0.0000i 0.5774 + 0.0000i 0.5774 - 0.0000i
0.2540 + 0.0000i 0.5774 + 0.0000i 0.5774 + 0.0000i
0.3810 + 0.0000i -0.5774 - 0.0000i -0.5774 + 0.0000i

D = 3×3 complex
11.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 6.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 6.0000 - 0.0000i

Department of Mathematics, SIT, Tumakuru 53


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 8

SOLUTION OF FIRST ORDER ORDINARY DIFFERENTIAL EQUATIONS

Aim: To solve First Order Ordinary Differential Equation and to plot their solution curves

Matlab command: dsolve

Syntax: dsolve Symbolic solution of ordinary differential equations.

dsolve(eqn1,eqn2, ...) accepts symbolic equations representing ordinary differential equations and
initial conditions.

By default, the independent variable is 't'. The independent variable may be changed from 't' to some
other symbolic variable by including that variable as the last input argument.

Activities: Solve and plot the solution curves for the following

1) 2)

3) 4)

5) 6)

7)

Department of Mathematics, SIT, Tumakuru 54


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Solve

syms y(x)
Dy=diff(y);
f=dsolve(Dy+cos(x)*y==cos(x)) %General solution
fimplicit(f)
dsolve(Dy+cos(x)*y==cos(x),y(0)==0) % Particular solution

f =

ans =

Department of Mathematics, SIT, Tumakuru 55


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Solve

clear
syms y(x)
Dy=diff(y);
f=dsolve(Dy-y==x*exp(x)) %General solution
fimplicit(f)
dsolve(Dy-y==x*exp(x),y(0)==0) % Particular solution

Solve

clear
syms y(x)
Dy=diff(y);
f=dsolve(Dy+y==exp(-x))
% plot the slution curve
fimplicit(f)
% solution with initial condition
dsolve(Dy+y==exp(-x), y(0) == 1)

f =

ans =

Department of Mathematics, SIT, Tumakuru 56


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Solve

clear
syms y(x)
Dy=diff(y);
f=dsolve(Dy+sin(x)*y==sin(x))
% plot the slution curve
fimplicit(f)
% solution with initial condition
dsolve(Dy+sin(x)*y==sin(x), y(0) == 1)

f =

ans = 1

Solve

clear
syms y(x)
Dy=diff(y);
f=dsolve(Dy+cot(x)*y==cos(x))

f =

Department of Mathematics, SIT, Tumakuru 57


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Solve Solve

clear
syms y(x)
Dy=diff(y);
f=dsolve(Dy-2*y/(1+x)==1/(x+1)^3)
% plot the slution curve
fimplicit(f)

f=

Department of Mathematics, SIT, Tumakuru 58


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Solve

clear
syms y(x)
Dy=diff(y);
f=dsolve(Dy+y*cot(x)==4*x/sin(x))
% plot the slution curve
fimplicit(f)

f =

Department of Mathematics, SIT, Tumakuru 59


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 9

EUCLID'S ALGORITHM

Aim: To find Greatest Common Divisor (gcd) for two integers using Euclid's algorithm

Matlab command: rem

Syntax: rem(x,y) Remainder after division.

Procedure: Euclid's Algorithm

a=b*q+r

b=r*q+r1

r=r1*q+r2

..........

continue till remainder becomes ZERO

rn=rn-1*q+0

The non-zero remainder represents the gcd.

Activities: Find the gcd for the following pair of numbers

1) (21,36) 2) (-41,-17) 3) (12,-120) 4) (0,15)

Assignment : Using gcd find the lcm of the numbers

Department of Mathematics, SIT, Tumakuru 60


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

clear
clc
a=input('Enter the value of a:');
b=input('Enter the value of b:');

if (a~=0 & b~=0)


a1=a;b1=b;
if (a<0|b<0)
a=abs(a);
b=abs(b);
end
r=a;
while ( r~=0 )
r=rem(a,b);
a=b;
b=r;
end
gc=a;
fprintf ( 'gcd(%d,%d) = %d \n',a1,b1, gc);
else
fprintf ( 'Enter the non-zero numbers');
end

1)
Enter the value of a:21
Enter the value of b:36

gcd(21,36) = 3

2)
Enter the value of a:-41
Enter the value of b:-17

gcd(-41,-17) = 1

3)
Enter the value of a:12
Enter the value of b:-120

gcd(12,-120) = 12

4)
Enter the value of a:0
Enter the value of b:15

Enter the non-zero numbers

Department of Mathematics, SIT, Tumakuru 61


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Laboratory - 10

BETA AND GAMMA FUNCTIONS

Aim: Evaluate Gamma Function

Syntax: Y = gamma(X)

Y = gamma(X) returns the gamma function evaluated at the elements of X

Gamma Function

The gamma function is defined for real x > 0 by the integral:

e
t
Γ(x) = t x 1 dt

The gamma function interpolates the factorial function. For integer n:


gamma(n+1) = factorial(n) = prod(1:n).
The domain of the gamma function extends to negative real numbers by analytic continuation, with simple poles at the negative
integers. This extension arises from repeated application of the recursion relation
Γn−1= Γn / n−1

Evaluate the gamma function with a scalar and a vector

Evaluate Γ(0.5), which is equal to  1.772453851 1.7725


y = gamma(0.5) ans = 1.7725

gamma(1) ans = 1

gamma(3/2) ans = 0.8862

gamma(0) ans = Inf

gamma(3) ans = 2

x = 1:5; y = gamma(x)
y = 1 1 2 6 24

x = 5:10; y = gamma(x)
y = 24 120 720 5040 40320 362880

x = -3.5:3.5; y = gamma(x)
y = 0.2701 -0.9453 2.3633 -3.5449 1.7725 0.8862 1.3293 3.3234

Plot Gamma Function

Plot the gamma function and its reciprocal.

Use fplot to plot the gamma function and its reciprocal. The gamma function increases quickly for positive arguments and has
simple poles at all negative integer arguments (as well as 0). The function does not have any zeros. Conversely, the reciprocal
gamma function has zeros at all negative integer arguments (as well as 0).

X — Input array: scalar | vector | matrix | multidimensional array


Input array, specified as a scalar, vector, matrix, or multidimensional array. The elements of X must be real.

Department of Mathematics, SIT, Tumakuru 62


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

fplot(@gamma)
hold on
fplot(@(x) 1./gamma(x))
ylim([-10 10])
legend('\Gamma(x)','1/\Gamma(x)')
hold off
grid on

Beta function
Aim: Evaluate Beta Function
Syntax: B = beta(Z,W)
B = beta(Z,W)returns the beta function evaluated at the elements of Z and W. Both Z and W must be real and
nonnegative.
Beta Function

The beta function is defined by

t
z 1
B(z,w)= (1  t ) w1 dt =Γ(z) Γ(w) / Γ(z+w).
0

t
Z 1
The Γz term is the gamma function Γ(z) = e  z dt
0
Z — Input array scalar | vector | matrix | multidimensional array
Input array, specified as a scalar, vector, matrix, or multidimensional array. The elements of Z must be real and nonnegative. Z and W
must be the same size, or else one of them must be a scalar.
W — Input array scalar | vector | matrix | multidimensional array
Input array, specified as a scalar, vector, matrix, or multidimensional array. The elements of W must be real and nonnegative. Z and W
must be the same size, or else one of them must be a scalar.

If Z or W is equal to 0, the beta function returns Inf.


If Z and W are both 0, the beta function returns NaN

Evaluate the Beta function with a scalar and a vector

B = beta(3,5) ANS B = 0.009 since 1/105=0.009523

B = beta(3/2,5/2) B = 0.1963

B = beta(3/2,2) B = 4/15 = 0.2667

B = beta(5,4) B = 1/280 = 0.0036


Department of Mathematics, SIT, Tumakuru 63
AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Compute Beta Function for Integer Arguments


Compute the beta function for integer arguments w=3 and z=1,...,10. Based on the definition, the beta function can be calculated as

B(z,3)=Γz Γ3 / Γ(z+3)=(z−1)! 2! / (z+2)! = 2/ z(z+1)(z+2).

Set the output format to rational to show the results as ratios of integers.

format rat
B = beta((1:10)',3)

B = 1/3 1/12 1/30 1/60 1/105 1/168 1/252 1/360 1/495 1/660

Plot Beta Function

Calculate the beta function for z = 0.05, 0.1, 0.2, and 1 within the interval 0≤w≤10. Loop over values of z, evaluate the function at

each one, and assign each result to a row of B.

Z = [0.05 0.1 0.2 1];


W = 0:0.05:10;
B = zeros(4,201);
for i = 1:4
B(i,:) = beta(Z(i),W);
end

>> B
ANS B =

Columns 1 through 9

1/0 3905/98 7117/239 3535/134 3131/127 2808/119 2402/105 5699/255


5047/230 1/0 7117/239 7945/403 1420/87 4628/317 7952/587 2348/183
4283/348 1643/138
1/0 3131/127 4628/317 4632/413 3164/333 2461/291 2557/330 5439/752
6715/982 1/0 20 10 20/3 5 4 10/3
20/7 5/2

Columns 10 through 18 …………..

Plot all of the beta functions in the same figure.


plot(W,B)
grid on
legend('$z = 0.05$', '$z = 0.1$','$z = 0.2$','$z = 1$','interpreter','latex')
title('Beta function for $z = 0.05, 0.1, 0.2$, and $1$','interpreter','latex')
xlabel('$w$','interpreter','latex')
ylabel('$B(z,w)$','interpreter','latex')

Department of Mathematics, SIT, Tumakuru 64


AY2023-24
Matlab laboratory manual for Engineering Mathematics-I

Department of Mathematics, SIT, Tumakuru 65


AY2023-24

You might also like