0% found this document useful (0 votes)
2 views11 pages

Homework 2

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

Homework 2

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HOMEWORK 2

SUBMITTED BY:
NAME : HASHIR ABDULLAH
ROLL NO : 2023-R/2022-EE-129
SECTION : C
SUBMITTED TO:
Dr Habib Wajid
1) Semilog Plot

This script plots class size growth on a logarithmic y-scale to verify exponential behavior.
The data appears approximately linear on the semilog plot, confirming exponential growth
behavior.

2) Subplot and Axis Modes


This script displays the MIT image in four subplots with different axis modes.
Changing axis modes affects scaling and orientation; axis xy flips the image vertically.

3) Bar Graph
This script generates 5 random values and displays them using a red bar graph
Each run produces different bar heights since values are randomly generated.

4) Random Surface with Interpolation


This script creates a random surface, interpolates it smoothly, and plots surface with contours.
Cubic interpolation makes the surface smooth, and contours clearly show variation in height.

5) findNearest Function
This function returns the index of the value closest to a desired number.
6) loopTest Function
This function checks divisibility of numbers from 1 to N using loops and conditional statements.

7) Smoothing Filter
This function applies a symmetric moving average filter to smooth noisy data.
Test script:
8) Plot a Circle
Function: getCircle: This function generates x and y coordinates of a circle with given center
and radius.

For concentric circles:


This script plots five concentric circles using jet colormap.

All circles share the same center and maintain equal scaling due to axis equal.
For Olympic rings:
The rings are correctly positioned and scaled, forming the Olympic logo pattern.

You might also like