Code covered by the BSD License  

Highlights from
OSCAR

image thumbnail
from OSCAR by Jerome Degallaix
An optical FFT code to simulate Fabry Perot cavities with arbitrary mirror profiles

Read_mode_name(name)
function [family m n] = Read_mode_name(name)
%Read_mode_name() = takes the name and returns the family name and the mode numbers
% family = 'HG' or 'LG'   m,n order of the mode

family = name(1:2);

ind_space = strfind(name,' ');

m =  str2double( name(ind_space(1)+1:ind_space(2)-1) );
n  = str2double( name(ind_space(2)+1:end) );


end

Contact us at files@mathworks.com