we took deez from gingerman thank you :D

This commit is contained in:
LinlyBoi
2023-05-14 21:57:13 +03:00
parent 07fe9a89b0
commit 3e5900773e
5 changed files with 83 additions and 0 deletions

15
expon.m Normal file
View File

@@ -0,0 +1,15 @@
% exponential model a * exp(b * x)
% y = a + b x
clear;clc;close all;
x = input("enter values of x:\n");
y = input("enter values of y:\n");
Y = log(y);
n = length(x);
coeff = [n sum(x);sum(x) sum(x.^2)];
f_terms = [sum(Y);sum(x.*Y)];
results = inv(coeff) * f_terms;
A = results(1);
a = exp(A);
b = results(2);
f = a * exp(b*x);
plot(x, y,'',x, f);