Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. g = fittype('a*integral(@(tau) (Cp(tau)./(1-.42)).*exp((-x-tau).*(a/b)),0,x)','coeff',{'a','b'});
  2. fit(T,AvgYf,g);
  3.  
  4. function varout = Cp(varin)
  5.  
  6. p = [.809,.330,.17046, 0.365, .0563, .132, 1.020, .1685, 38.078, .483];
  7.  
  8. max = size(varin);
  9. varout = zeros(1,max(2));
  10.  
  11. n = 1;
  12.  
  13. while n < max(2) + 1
  14. varout(n) = p(1)/(p(5)*sqrt(2*pi))*exp(-(varin(n)-p(3)).^2/(2*p(5)^2))+ p(2)/(p(6)*sqrt(2*pi))*exp(-(varin(n)-p(4)).^2/(2*p(6)^2)) + p(7)*exp(-p(8)*varin(n))/(1+exp(-p(9)*(varin(n)-p(10))));
  15. n = n + 1;
  16. end
  17.  
  18. end
  19.  
  20. Error using fittype (line 356)
  21. Expression a*integral(@(tau) (Cp(tau)./(1-.42)).*exp((-x-tau).*(a/b)),0,x) is not a valid MATLAB expression, has non-scalar
  22. coefficients, or cannot be evaluated:
  23. Error in fittype expression ==> a.*integral(@(tau) (Cp(tau)./(1-.42)).*exp((-x-tau).*(a./b)),0,x)
  24. ??? A and B must be floating point scalars.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement