Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Diffraction Grating
- % Determines the angle at whcih the beam axis will first and second order peak will
- % occur
- % Inputs and Variables
- l = input('Number of lines per mm\n');
- lambda = input('Wavelength\n');
- n = input('Order(s)\n');
- a = numel(n);
- % Outputs and Equations
- d = 10^-3/l;
- for i = 1:a
- m = n(i);
- theta(i) = asin(m*lambda/d);
- fprintf('Order %i angle:\n',n(i))
- fprintf('%.3f rad\n', theta(i))
- end
- %{
- If user inputs multiple orders in [] then calculations will be carried out
- for those orders
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement