0
$\begingroup$

I am pretty new to maple and have the following question:

If I define a vector q containing a parameter b should i define it like:

q := vector[column]([b, 0]) 

or like

q(b) := vector[column]([b, 0]) 

1 Answers 1

1

It depends upon what you want to do with "q". If you simply want to refer to your vector, without instantiating the parameter "b", you can just use the first form. But, if you want to construct various vectors with different values of the parameter "b", you should probably define "q" to be a procedure with parameter "b". It appears that you may be trying to do just that with the second form, but it is not quite correct. Perhaps confusingly, the second form does create a procedure "q", but it is probably not what you expect. The syntax you are looking for in this case is probably

q := b -> Vector[column]([b,0]); 

They way you wrote it, you get a procedure that returns a vector for the literal input `b' (i.e., the name `b`), whereas you probably want `q( 2 )' to return a vector with a "2" in it. (If I'm wrong in my assumptions about what you are trying to do then this advice is, of course, useless.)

  • 0
    @stefan Yes, it sounds like this would be the right synta$x$ for your situation.2011-10-19