function [x,px] = canonicf(c,pm) % CANONICF [x,px] = canonicf(c,pm) Function version of canonic % Version of 6/12/95 % Allows arbitrary naming of variables n = length(c) - 1; if 2^n ~= length(pm) error('Incorrect minterm probability vector length'); end M = mintable(n); % Provides a table of minterm patterns s = c(1:n)*M + c(n+1); % Evaluates X on each minterm [x,px] = csort(s,pm); % s = values; pm = minterm probabilities