 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] evalm and mapping of function
| [MUG] evalm and mapping of function |
|
Author: Guy Gendron
Posted: Thu, 30 May 2002 09:42:32 -0400
|
>> From: Guy Gendron "ggendron"
Dear all,
I dont understand why Maple cannot map the "fcncarre" function onto the
elements of the matrix "mat_a". I am trying to use evalm to square each
element of the input matrix. It does not work with my own function
(fcncarre) but it works with sin (see example below). What is the
difference between "sin" and "fcncarre". How would I proceed to apply
a transformation to each element of a matrix without using for loops.
I am working with Maple 7 on Windows 98.
Thanks in advance,
Best regards,
Guy Gendron
> print(mat_a); # mat_a is a matrix
[1 2 3]
[ ]
[4 5 6]
> fcncarre:=x->x*x; # I define a new function
2
fcncarre := x -> x
> evalm(fcncarre(mat_a));#I want evalm to map the fonction onto each elem.
of mat_a
Error, (in linalg[multiply]) non matching dimensions for vector/matrix product
> evalm(sin(mat_a)); # It works with sin!
[sin(1) sin(2) sin(3)]
[ ]
[sin(4) sin(5) sin(6)]
|
[View Complete Thread]
Previous by date: [MUG] Re: plots[display]: Error, (in plots/object2plot) bad
object to display symbol, Robert Israel
Next by date: [MUG] Can Maple use 2 CPUs?, Vladimir Bondarenko
Previous thread: [MUG] Maple 6.0 / Redhat 7.3, Stefan Kornhuber
Next thread: [MUG] Can Maple use 2 CPUs?, Vladimir Bondarenko
|
|
|