Code covered by the BSD License  

Highlights from
CO2gui - lab control and automation

CO2gui - lab control and automation

by

 

06 Jan 2010 (Updated )

Software used for controlling and data logging lab equipment.

isainteger(number)
function response = isainteger(number)
% ISAINTEGER tests for if it is an integer or not

% checks the number of arguments
error(nargchk(1, 1, nargin))

% checks the number
response = ~isempty(number) && (isnumeric(number) || islogical(number));

% if it is a number, check it some more
if response && isnumeric(number) && isreal(number)
    % check
    response = ~isnan(number) & isfinite(number) & number == round(number);
    
else
    % returns a false response the size of the object
    response = false(size(number));
end

Contact us