Advertisement
Guest User

Untitled

a guest
Mar 4th, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.34 KB | None | 0 0
  1. R=[2.91 2.19 1.76 1.43 1.20 1.01 0.88 0.77 0.67 0.6 0.52 0.46 0.41 0.37];
  2. t=[35:5:100];
  3. T=t+273.15;
  4.  
  5.  
  6. function coeff = least_square (x,y)
  7.   n = length(x);
  8.   A = [x ones(n,1)];
  9.   coeff = A \ y;
  10.   nplot(x,y,'x');
  11.   hold on
  12.   interv = [min(x) max(x)];
  13.   plot(interv,coeff(1)*interv+coeff(2));
  14. end
  15.  
  16. least_square(x, y) % dimensions mismatch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement