Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all
- ev=[1.209 4.055 9.387 18.48 27.58 35.66 39.86 49.13 53.97 56.72 66.63 70.65 75.13 80.11 85.7 92.02 93.38 95.49 96.94 99.19 100.7 106.53 107.42 110.13 112.94 114.9];
- re=[61 19.3 10.2 6.1 4.5 3.7 3.4 2.9 2.7 2.6 2.3 2.2 2.1 2 1.9 1.8 1.78 1.75 1.73 1.7 1.68 1.61 1.6 1.57 1.54 1.52]';
- CCoef=@(ev)[1 -log(ev)];
- m = length(ev);
- n = length(CCoef(NaN));
- A=zeros(m, n);
- for i=1:m
- A(i,:)=CCoef(ev(i));
- end
- ATA=A'*A;
- ATB=A'*re;
- c=ATA\ATB;
- predfn=@(ev)(c(1)-c(2)*log(ev));
- fplot(predfn, [-1 115], 'red')
- hold on
- plot(ev, re', '*')
- xlabel('iluminare[lx]')
- ylabel('R[kOhm]')
- title('caracteristica fotorezistor')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement