view assertSize.m @ 767:97f24d151a6e feature/grids

Simplify assertSize
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 26 Jun 2018 14:02:31 +0200
parents afd20f023928
children dec0447cbf2c
line wrap: on
line source

% Assert that array A has the size s.
function assertSize(A,s)
    errmsg = sprintf('Expected %s to have size %s, got: %s',inputname(1), toString(s), toString(size(A)));
    assert(all(size(A) == s),errmsg);
end