Ask Your Question

# Revision history [back]

### Using matrix elements as arguments

I have a rather easy question, or so it would seem. I have looked for an answer but was unable to find one anywhere so I'm asking it here.

I am making a very simple iterative algorithm for which the input as well as the output at the end of every iteration is a vector (or matrix for that matter). What I want to do is use these elements as arguments for several functions during each of the iteration. So for example

x=var('x')
y=var('y')
z=matrix(2,1,[ , ]
f=x^2+y^3
H=f.hessian()


Then what I would like to do is say

H(z,z)


or

H(z)


But no matter what I try I can't seem to get it to work. Ideas? 2 retagged

### Using matrix elements as arguments

I have a rather easy question, or so it would seem. I have looked for an answer but was unable to find one anywhere so I'm asking it here.

I am making a very simple iterative algorithm for which the input as well as the output at the end of every iteration is a vector (or matrix for that matter). What I want to do is use these elements as arguments for several functions during each of the iteration. So for example

x=var('x')
y=var('y')
z=matrix(2,1,[ , ]
f=x^2+y^3
H=f.hessian()


Then what I would like to do is say

H(z,z)


or

H(z)


But no matter what I try I can't seem to get it to work. Ideas? 3 retagged

### Using matrix elements as arguments

I have a rather easy question, or so it would seem. I have looked for an answer but was unable to find one anywhere so I'm asking it here.

I am making a very simple iterative algorithm for which the input as well as the output at the end of every iteration is a vector (or matrix for that matter). What I want to do is use these elements as arguments for several functions during each of the iteration. So for example

x=var('x')
y=var('y')
z=matrix(2,1,[ , ]
f=x^2+y^3
H=f.hessian()


Then what I would like to do is say

H(z,z)


or

H(z)


But no matter what I try I can't seem to get it to work. Ideas?