Code covered by the BSD License  

Highlights from
Nuclear Medicine Calculator

image thumbnail
from Nuclear Medicine Calculator by Omer Demirkaya
It is a simple decay calculator with most of the nuclear medicine isotopes.

gethalflifeunit(numb)
% This function get the unit given the number
% numb: 1 = sec, 2 = min,3 = hour,4  = day,5 = year
% and returns the conversion factor for each unit to seconds
function [tunit,cf] = gethalflifeunit(numb)
switch numb
    case 1
        tunit = 'sec';
        cf    = 1;
    case 2
        tunit = 'min';
        cf    = 60;
    case 3
        tunit = 'hrs';
        cf    = 3600; %60*60
    case 4
        tunit = 'days';
        cf    = 86400; %24*60*60;
    case 5
        tunit = 'yrs';
        cf    = 31536000; %365*24*60*60;
    otherwise
        errordlg('unknown number');
        tunit = '';
        cf    = 0;
end

Contact us at files@mathworks.com