Post Reply 
when will be ready a program editor for the CAS MODE ?
01-27-2014, 05:31 PM (This post was last modified: 01-27-2014 05:47 PM by compsystems.)
Post: #7
RE: when will be ready a program editor for the CAS MODE ?
Quote:poly2symb  Syntax: poly2symb(Lst,Var) 
Returns a polynomial (orthe polynomial and its value) in Var (by default x CAS MODE X home MODE), the polynomial being defined 
by the vector of coefficents in Vect . 
Examples

CAS MODE and simplify none:  

poly2symb([1,2,3]); [enter] returns (x+2)*x+3 
poly2symb([1,2,3],x); [enter] returns (x+2)*x+3  
poly2symb([1,2,3],x=2); [enter] returns (x+2)*x+3=11 ?

HOME MODE and simplify none:  

poly2symb([1,2,3]); [enter] returns (X+2)*X+3 
poly2symb([1,2,3],x); [enter] returns  "error: sintaxis error"
poly2symb([1,2,3],x=2); [enter] returns  "error: sintaxis error"


Quote:symb2poly  Syntax: symb2poly(Expr,[Var]) or symb2poly(Expr, ListVar) 
Returns the coefficients of a polynomial Expr with respect tothe variable Var or if the second argument is 
a list returns the internal format of the polynomial. Essentaiilly the inverse of poly2symb(). 
Example: 

symb2poly( (x+2)*x+3,x) returns [1,2,3] 

Code:
//convolution Version2
convolution2(v1,v2,var):=
begin 
  local p1,p2,c; 
  p1:=poly2symb(v1,var); 
  p2:=poly2symb(v2,var); 
  c:=symb2poly(simplify(p1*p2),var);
  return(c); 
end;

CAS MODE

convolution2([1,2,3,4],[5,6,7,8],y); [enter] returns [5,16,34,60,61,52,32] // OK

HOME MODE

convolution2([1,2,3,4],[5,6,7,8],y); [enter] returns "error: sintaxis error"
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: when will be ready a program editor for the CAS MODE ? - compsystems - 01-27-2014 05:31 PM



User(s) browsing this thread: 1 Guest(s)