function mout = pulse(alpha,phase,minp) %PULSE % Applies an RF pulse to the magnetization column vector 'minp'. % alpha ... is the pulse nutation angle in radians, % phase ... is the pulse RF phase in radians % The rotated magnetization is returned in the column vector 'mout' % For the relevant theory, see % www.ebyte.it\library\educards\nmr\NmrMath_PulseAndDelayOps.html ca = cos(alpha); sa = sin(alpha); cf = cos(phase); sf = sin(phase); omca = 1-ca; P = [[ca+(1-ca)*cf*cf; (1-ca)*sf*cf; sa*sf],... [(1-ca)*sf*cf; ca+(1-ca)*sf*sf;-sa*cf],... [-sa*sf; sa*cf; ca]]; mout = P*minp;