function mpa(v,eq,s)
%MPA	Maple assignment.
%	MPA('v','expr') assigns expr to the symbolic variable v
%	in the Maple workspace. expr may be a symbolic variable, a symbolic
%	expression, or a numeric quantity.
%
%	The command form of this statement is often useful. In this case,
%	there are three variations of the command form:
%	    mpa v = expr 
%	    mpa v := expr
%	    mpa v expr
%	These three forms are valid only when the general command form 
%	is valid, with the exception of assignment.
%
%	To retrieve the contents of v from the Maple workspace, 
%	use one of the following:
%	    v = maple('v')
%	    v = maple('print(v)')
%
%	Examples:
%	   mpa a = 1
%	   mpa b = sqrt(1/2)
%	   mpa s = (a+b)/2
%
%	   mpa('P',pascal(3))
%	   mpa R = evalm(inverse(P-s*eye))
%	   maple print(R)
%
%	See also MAPLE, VPA, NUMERIC.

%	Copyright (c) 1993-95 by The MathWorks, Inc.
%	$Revision: 1.7 $  $Date: 1995/03/01 21:38:54 $

if nargin == 1
   s = ['' v ''];
elseif nargin == 3
   if ~(eq == '=' | strcmp(eq,':='))
      error('Second argument must be ''='' or '':=''.')
   end
else
   s = eq;
end
if ~isstr(s)
   s = sym(s);
end
if s(1) == '['
   s = sm2ar(s);
end
maple([v ':=' s]);
