Robochameleon  v1.0
log2M.m
1 function log2M = log2M(M)
2 
3 if ~isscalar(M) || ~isreal(M) || M<1 || ~isfinite(M)
4  error('M must be a positive real finitie scalar.');
5 end
6 log2M = log2(M);
7 if ~iswhole(log2M) || log2M<1
8  error('M must be a number 2^k, where k is a positive integer.');
9 end
function iswhole(in x, in tol)
Determine whether or not input is a whole number.