function S=reducmat(A,n,m);
%REDUCMAT is used to delete the nth row and the mth column from A to get
% the smaller matrix S.
%
% INPUTS:
% (i) A = matrix to be reduced
% (ii) n = row to be deleted; if n=0, no row is deleted.
% (iii) m = column to be deleted; if m=0, no column is deleted.
%
% OUTPUTS:
% (i) S = A with the nth row and mth column removed
%
[p,q]=size(A);
if (p