You are on page 1of 1

close all; clc;

%Load data file


data = readtable("P1L1.txt");

%Fitting Coefficient
a = 0.382;
b = 24.08;
c = 6.856;
p1 = 0.01139;
p2 = -0.02901;

x = linspace(0,2.8,100);
x1 = linspace (2.55,2.8,100);
y = a*(exp(-b))*(exp(c.*x)- 1);
y1 = p1.*x1+p2;
V = data. V_Volt_;
I = data. I_Ampere_ ;

%plotting
scatter(V,I);
hold on
plot(x,y,x1,y1);
hold off
xlabel("V (volt)");
ylabel ("I (A)");
xlim ([0,2.7]);
legend('fitting','data','Regresi Linear');

You might also like