clc
clear

N = 11
x = linspace(0,30,N)

y = [5.13 3.20 2.46 1.74 1.18 1.03 0.574 0.424 0.293 0.197 0.155] 
figure
plot(x,y,'-o'), title('Linear Plot') 
figure
loglog(x,y,'-o'), title('Log-Log Plot')
figure
semilogy(x,y,'-o'), title('Semi-Log y Plot')

p = polyfit(x,log10(y),1)
m = p(1)
b = 10^p(2)
xplot = linspace(0,30,100);
yplot = b*(10).^(m*xplot);
xpoint = 16.7
ypoint = b*(10).^(m*xpoint)
figure

plot(xplot,yplot,x,y,'o',xpoint,ypoint,'rs')
xlabel('x'), ylabel('y')
title('Final Exam Problem No.4 by Zhoria R')

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: