Maintaining function arguments when creating a matrix using function

August 09 2011 by MRI_user 0
false
Maple 15

0


Hi, this may be a stupid question, but I have trouble getting it right...

I want to create a matrix from a function that uses some of the arguments of the fuction as indices, but want to carry on the other arguments, here is an example of what I have:

MyFunction:=(a,b,c,k,l)->a+b+c+k+l;

MyMatrix:=Matrix(3,3,(k,l)->MyFunction(a,b,c,k,l)); # this is working but not what I want

MyMatrix now contains a,b,c as variables but not as function parameters (meaning something of the form MyMatrix(a,b,c)), however I would need them as funtion parameters to be able to assign a new function like:

MySecondFunction:=(x,y,z)->MyMatrix(a,b,c);

This should yield:

                        | x+y+z+2  x+y+z+3 x+y+z+4 |
                        | x+y+z+3  x+y+z+4 x+y+z+5 |
                        | x+y+z+4  x+y+z+5 x+y+z+6 |

I hope this makes sense and there is a solution to this.

Thanks so much for any thoughts...

 

 
Loading Comments & Answers

You must be logged into your MaplePrimes account in order to post a comment. If you don't have an account, you can create an account here.

     

Forgot Your Password? Create an Account