Library of general matlab functions