0% found this document useful (0 votes)
8 views9 pages

Final BSP

Uploaded by

Muneeba Bukhari
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)
8 views9 pages

Final BSP

Uploaded by

Muneeba Bukhari
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
You are on page 1/ 9

LAB#02

x= [10 20 30 35 46 54 58 61 72]
y=sin(x)
subplot(1,3,1)
plot(y)
xlabel('time')
ylabel('amplitude')
title('Sine wave')
z=sqrt(x)
subplot(1,3,2)
plot(z)
xlabel('time')
ylabel('amplitude')
title('Square root of x-values')
Output=y+z
subplot(1,3,3)
plot(Output)
xlabel('time')
ylabel('amplitude')
title('Combination of sine(x) and sqrt(x) waves')

INTERPRETATION: In the above code, we have represented a sine wave changing its
amplitude with respect to time and another waveform which actually plots the square root of
time values on the y axis. The last figure shows the combination of the previous two waveforms
by concatenating them.
LAB#03
TASK#01
 BAR CHARTS:
Bar charts usually present categorical variables, discrete variables or continuous variables grouped
in class intervals.
 AREA PLOT:
An area chart is a graph that combines a line chart and a bar chart to show changes in quantities
over time.

 STAIR STEP PLOT:


Stairs( X , Y ) plots the elements in Y at the locations specified by X . The inputs X and Y must
be vectors or matrices of the same size.

 PIE CHART:
A pie chart, sometimes called a circle chart, is a way of summarizing a set of nominal data or
displaying the different values of a given variable (e.g. percentage distribution). BARh: It is used
to make a horizontal bar plot.

 STEM AND LEAF PLOT:


It is also called a stem and leaf diagram and it is a way of organizing data into a form that makes
it easy to observe the frequency of different types of values.

 POLAR PLOT:
The polar plot representation is the graphical representation of Y(jω). The polar plot is obtained
as the locus of the real and imaginary parts of Y(jω) in the polar plane. The coordinates of the
polar plot are the real and imaginary parts of Y(jω).

 SCATTER PLOT:
Scatter plots are the graphs that present the relationship between two variables in a data-set.
TASK#02
1)
cancerpatients=[40,60,30,10,19,50,100]
figure
pie(cancerpatients)
title('PERCENTAGE OF CANCER PATIENTS IN VARIOUS HOSPITALS')

INTERPRETATION:
The above pie shart shows the perecentages of cases of cancer in a number of hospitals in Karachi.
The largest percentage of cases were found to be in Ashfaque Memorial Hospital and the least
cases were in Darul-Sehat Hospital.
2)
x=[2000,2005,2010,2015];
y = [16 20; 18 25; 25 34;30 50];
bar(x,y)
xlabel("Years")
ylabel("Osteoporosis")
title("Disease frequency over time")

INTERPRETATION:
The above bar graph shows the frequency of cases of osteoporosis male and female patients with
time. It can be said that the frequency of both of male and female patients increase with respect to
time. However it can be seen that osteoporosis percentage in females remains higher with respect
to males.
3)
time= linspace(1,20,10)
Blood_glucose_level=[ 7 9 10 3 16 14 20 45 36 12]
stairs(time, Blood_glucose_level)
xlabel("TIME")
ylabel("BLOOD GLUCOSE LEVEL")
title("STAIRPLOT SHOWING VARIATIONS IN BLOOD SUGAR LEVEL
WITH RESPECT TO TIME")

INTERPRETATION:

For the above graph, we have created an equally spaced vector consisting of 1-20
with 10 points in between using linspace command. It shows the variations in blood
glucose level of a patient with respect to time.
LAB#04
TASK#01
1. Plot3

plot3( X , Y , Z ) plots coordinates in 3-D space. To plot a set of coordinates connected by line
segments, specify X , Y , and Z as vectors of the same length. To plot multiple sets of coordinates
on the same set of axes, specify at least one of X , Y , or Z as a matrix and the others as vectors.

2. Scatter3

scatter3( X , Y , Z ) displays circles at the locations specified by X , Y , and Z . To plot one set of
coordinates, specify X , Y , and Z as vectors of equal length. To plot multiple sets of coordinates
on the same set of axes, specify at least one of X , Y , or Z as a matrix. (

3. Contour3

Contour3 creates a three-dimensional contour plot of a surface defined on a rectangular grid.

4. Quiver3

quiver3( Z , U , V , W ) plots arrows with directional components specified by U , V , and W at


equally spaced points along the surface Z . If Z is a vector, then the x-coordinates of the arrows
range from 1 to the number of elements in Z and the y-coordinates are all 1.

5. Fill3

The fill3 function creates flat-shaded and Gouraud-shaded polygons.


TASK#02:
Days=10:10:100;
Cholesterol_level=[200 185 180 175 165 154 143 132 124 110];
Medication_sessions=[1 2 3 4 5 6 7 8 9 10]
plot3(Medication_sessions,Cholesterol_level,Days)
xlabel('Medication sessions')
ylabel('Cholesterol level')
zlabel('Days')
title('Decrease in cholesterol levels with progressive
medication sessions')
grid on

INTERPRETATION:

The above graph shows that the cholesterol level drops with an increase in the medication sessions
as the days pass.
LAB#05
x = linspace(150,50,20);
y = linspace(10,50,10);
[X,Y] = meshgrid(x,y);
Z = X .* Y;
contour(X,Y,Z)
title('Body temperature normalization with an increase in
medication dose')
xlabel('Medication Dose')
ylabel('Body Temperature')

INTERPRETATION:
The figure shows a contour plot of the product of medication dose and body temperature . The x-
axis represents the range of medication dose values from 50 to 150, and the y-axis represents the
range of Body temperature values from 10 to 50 celcius. The contours on the plot indicate different
values of the product of medication dose and body temperature, which is calculated by taking the
product of medication dose and body temperature at each point on the grid.
The contour plot shows that the product of medication dose and body temperature increases as the
medication dose increases and the body temperature increases. The contour lines on the plot are
evenly spaced, indicating that the product of medication dose and body temperature increases at a
constant rate as the medication dose and body temperature values increase. Overall, the figure
provides a visual representation of the relationship between medication dose and body
temperature.
LAB#06
clc;
clear all;
close all;
Cholesterol_levels=[150 200 140; 200 250 170; 250 280 190];
Months={'December', 'May', 'January'};
Patients={'PatientA', 'PatientB', 'PatientC'};
h= heatmap(Patients,Months,Cholesterol_levels);
h.title('VARIATIONS IN CHOLESTEROL LEVEL OF PATIENTS WITH TIME')
h.xlabel('PATIENTS')
h.ylabel('MONTHS')

INTERPRETATION:
The above heat map shows that cholesterol levels of patients are dropping as the time passes by
and treatment is given. The darker regions indicate a higher amount of cholesterol level whereas
the lighter regions indicate the opposite.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy