Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mojaapro(x,y)
- %dane od Sypki: x [0 5] y [0 2]
- figure
- plot(x,y,'b*')
- grid on
- % f(x)=A*(1-e^(-Bx))
- constant = lsqcurvefit(@funapro, [0.5;0.25], x, y);
- A = constant(1)
- B = constant(2)
- xfit = 0:0.1:5;
- yfit = funapro(constant,xfit);
- figure
- plot(x,y,'b*')
- hold on
- plot(xfit,yfit,'r','linewidth',2)
- grid on
- end
- function y = funapro(constant,x)
- y = constant(1)*(1-exp(((-1)*constant(2)*x)));
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement