function [X] = extrem(P);

mi = min(min(P));
ma = max(max(P));
X = [mi ma];
