Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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];
- t=[35:5:100];
- T=t+273.15;
- function coeff = least_square (x,y)
- n = length(x);
- A = [x ones(n,1)];
- coeff = A \ y;
- nplot(x,y,'x');
- hold on
- interv = [min(x) max(x)];
- plot(interv,coeff(1)*interv+coeff(2));
- end
- least_square(x, y) % dimensions mismatch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement