Documente Academic
Documente Profesional
Documente Cultură
Lab1 Assignment
Part A
Q1)
a. X=-3: .05:3;
Y=-3:.05:3;
These rows defined the range of x and y axis where we need to plot the
graph.
[X,Y]=meshgrid (x,y);
Z=-X.*X - 2.0.*Y.*Y+cos(3.0.*pi.*X)+03*cos(4.0.*pi.*Y)+4;
Z is defined as the function of X and Y.
contourf(X,Y,Z);
surfc(X,Y,Z);
X label (x1);
Y label (X2);
Z label (function value)
These 3 rows are defined the name of x ,y and z axis as x1,x2 and function
value respectively.
Grid on
This is indicate to on the grid around the graph.
b.
Q2)
r= zeros(1,32);
r(n)=rank(magic(n));
Part B
Q4)
Output1
Output2
Output3
Q5)