Re: How to find the exponents of terms in a symbolic polynomial using maple commands
- From: "Nasser Abbasi" <nma@xxxxxxxxx>
- Date: Thu, 27 Apr 2006 14:03:42 GMT
"Paul Lusina" <paull@xxxxxxxxxx> wrote in message
news:ef3271c.-1@xxxxxxxxxxxxxxxxxxx
Dear Newsgroup
I have generated a polynomial using the maple symbolic kernel in
matlab to give:
S = L^4+L^5
I now want to extract the powers of L to get a vector
V = [4 5]
Is there a command to do this in maple?
Thanks
Paul.
Since you asked for a maple command, this is how I would do it in Maple:
(need to use the maple command in Matlab to use these)
restart;
with(PolynomialTools);
s:=x^5+x^4;
CoefficientList(s,x);
This gives a a list which has zero entry corresponding to missing power of L
entry in the polynomial.
i.e it will give
[0,0,0,0,1,1]
So all what you need to do is find all the entries that are not zero. The
position of that non-zero entry corresponds to the power that L is raised
to. Hence you can that V you are looking for. So in the above you see that
the 4th position is non-zero, hence you know there is an x^4 term, etc...
The bottom line is that using output from symbolic maple with Matlab own
functions is not a very smooth operation. There seems to be some
discontinuity between the two (a step function at the boundaries :)
Some output from the symbolic part can be easily converted to Matlab types
and used, some is not so easy to do.
What is probably needed is a complete set of Matlab functions that converts
all known Maple generated data types (Lists, sequences, Matrix, Vector,
rTable, matrix, vector, set, etc...) to Matlab defined data structures
(matrix, cells, structs, etc..)
This will allow one to more easily use pass Maple output to Matlab functions
by wrapping them in this conversion routines.
Nasser
.
- Follow-Ups:
- References:
- Prev by Date: Re: How to demarcate areas in black and white 2D plots?
- Next by Date: sum of elements
- Previous by thread: How to find the exponents of terms in a symbolic polynomial using maple commands
- Next by thread: Re: How to find the exponents of terms in a symbolic polynomial using maple commands
- Index(es):
Relevant Pages
|