tuttelikz

Microscope [?]

Sep 3rd, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.00 KB | None | 0 0
  1. clear all; close all; clc;
  2.  
  3. f1 = 3.5;
  4. f2 = 6;
  5. % f1 = 3.5;
  6.  
  7. %     figure()
  8.  
  9. s1 = [10:1:15];
  10. M = zeros(1,length(s1));
  11.  
  12. L1 = f2+(s1(1)*f1)/(f1-s1(1));  %Boundary limit
  13. L2 = f2+(s1(end)*f1)/(f1-s1(end));  %Boundary limit
  14.  
  15. Lmin = min(L1,L2);
  16. Lmax = max(L1,L2);
  17.  
  18.  
  19. RangeL = [Lmin*1000:100:Lmax*1000];
  20.  
  21. %LRange = [615:100:1756];
  22.  
  23. for j = RangeL
  24.     L = j/1000;
  25.     for i = 1:length(s1)
  26.         num = L*f2*(f1-s1(i))-s1(i)*f1*f2;
  27.         den = s1(i)*(f1*(f2-L+s1(i))+s1(i)*(L-f2));
  28.     %     s1
  29.         M(i) = -num/den;
  30.     end
  31.     figure()
  32.     plot(s1,M);
  33.     title(['F1 = 3.5cm, F2 = 6cm, Length = ' num2str(L),'cm']);
  34.     ylabel('Magnification, times');
  35.     xlabel('Distance to object, cm');
  36.     grid on
  37. %     hold on
  38.    
  39. end
  40. %figure()
  41.  
  42. % hold on
  43. % hold off
  44. % legend(['L=' num2str(L)]);
  45. % legend('L = 0.615','L = 0.715','L = 0.815','L = 0.915','L = 1.015','L = 1.115','L = 1.215','L = 1.315','L = 1.415','L = 1.515','L = 1.615','L = 1.715')
  46.  
  47.  
  48. %
  49. % legend('3,5','4','4.5','5');
Advertisement
Add Comment
Please, Sign In to add comment