You are on page 1of 2

Muhammad Arif Bashir 2022-MS-EE-17

Matlab Code for Human Height Plot

Matlab Code:
age = 1:0.1:50;
exp_factor = 1.05;
height_until_18 = 100 * exp(log(exp_factor) * age(age <= 18));
height_after_18 = height_until_18(end) * ones(1, length(age(age > 18)));
height = [height_until_18 height_after_18];
% Plot the data
plot(age, height);
xlabel('Age (years)');
ylabel('Height (cm)');
title('Height of a Human')

Output:
Muhammad Arif Bashir 2022-MS-EE-17

Matlab Code for Human Heart Plot

Matlab Code:

t = linspace(-pi,pi, 350);
X = t .* sin( pi * .872*sin(t)./t);
Y = -abs(t) .* cos(pi * sin(t)./t);
plot(X,Y);
fill(X, Y, 'g');
axis square;
set(gcf, 'Position', get(0,'Screensize'));
title('Human Heart', 'FontSize', 15);

Output:

You might also like