Add some older Theory projects from the past years

This commit is contained in:
2026-03-25 09:45:42 +01:00
parent 5b90bc11a0
commit b4e735148e
17 changed files with 514 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
function frequency = wavelength2frequency(wavelength, inputUnit)
% Convert wavelength to optical frequency.
% Supported units: m, nm.
c = physconst('LightSpeed');
switch lower(inputUnit)
case 'm'
wavelength_m = wavelength;
case 'nm'
wavelength_m = wavelength .* 1e-9;
otherwise
error('Unsupported input unit "%s". Use "m" or "nm".', inputUnit);
end
frequency = c ./ wavelength_m;
end