0% found this document useful (0 votes)
47 views7 pages

EE4073 Lab1 Assignment: Part A

The document contains instructions for a lab assignment with 5 questions. Part A includes plotting a function, generating a bar graph showing the ranks of magic squares of different sizes, and finding the roots of a polynomial. Part B asks for output from questions 4 and 5 but does not provide the questions. The questions in Part A involve plotting functions, generating graphs, and analyzing polynomials.

Uploaded by

MB Fazli Nisar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views7 pages

EE4073 Lab1 Assignment: Part A

The document contains instructions for a lab assignment with 5 questions. Part A includes plotting a function, generating a bar graph showing the ranks of magic squares of different sizes, and finding the roots of a polynomial. Part B asks for output from questions 4 and 5 but does not provide the questions. The questions in Part A involve plotting functions, generating graphs, and analyzing polynomials.

Uploaded by

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

EE4073

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);

for n = 3:32 %loop for from 3 to 32

r(n)=rank(magic(n));

end % loop end

bar(r); %bar type graph


Q3) polynomial A
s=linspace(-5,5,100); %range of graph have to plot
coeff=[1 3 3 1]; %coefficient of equation S3+3S2+3S+1
A=polyval(coeff,s);
plot(s,A);
xlabel('s'); % name of X axis is s
ylabel('A(s)'); % name of y axis is A(s)
roots(coeff);%roots of above eqwuation

Part B

Q4)

Output1
Output2

Output3
Q5)

You might also like