Commit b5979863 authored by Pierre Cazenave's avatar Pierre Cazenave

Add slightly more robust input variable checks

parent f56b39db
......@@ -9,7 +9,7 @@ function [x0,y0,a] = centroid(x,y)
[m1,n1] = size(x); [m2,n2] = size(y);
n = max(m1,n1);
if [m1,n1] ~= [m2,n2] || min(m1,n1) ~= 1 || n <= 1
if (m1 ~= m2 && n1 ~= n2) || min(m1,n1) ~= 1 || n <= 1
error('Args must be equal-sized non-scalar vectors')
end
x = x(:); y = y(:);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment