function haxes = macplot(haxes,Phi)
%
%  Name: macplot
% 
%  Usage: haxes = macplot(haxes,Phi)
%
% 
%   Description:
%     Plots the MAC of the current Modal Set
%
%   inputs:
%	Phi = modal matrix
%
%	

%  Version SWD960817
%
%  Author(s): Scott W. Doebling, doebling@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%		ESA-EA
%
%  Copyright (c) 1996, The Regents of the University
%     	of California. (See top level of code for
%	full copyright statement.)

%
%  Compute the MAC
%

MACPHI = mac(Phi,Phi);

%
%  Generate xfp and yfp
%

nmodplot=size(Phi,2);

%for i = 1:nmodplot,
%    for j=1:nmodplot,
%	xfp(i,j) = i;
%	yfp(i,j) = j;
%   end
%end

xvalues = [1:nmodplot];
yvalues = [1:nmodplot];
 
xfp=ones(length(yvalues),1)*xvalues;
yfp=yvalues'*ones(1,length(xvalues));


%
%  Draw the plot
%

haxes = bar3D(xfp,yfp,MACPHI,'Primary Modal Set','Primary Modal Set','MAC',-1,haxes);


set(haxes,'XLim',[0 nmodplot+1],'Xtick',[1:nmodplot],'YLim',[0 nmodplot+1],'Ytick',[1:nmodplot],'Zlim',[0 1])
set(haxes,'box','on')

rotate3d on

return
