4

In calc, I have the following:

1. [1, 2, 3]
2. x + 1

I want to apply the function in 2 to every value of the vector as it's argument, so the result should look like this:

1. [2, 3, 4]

Is there a way to do this? I tried with the mapping functionalities V M +, V M -, etc and they are close to what I need, but not quite.

I know that V M ' exists, and it's pretty close, but I'd like to use an equation that's on the stack.

1 Answer 1

4

I think I found the answer.

Having in the stack:

1. [1, 2, 3]
2. x + 1

If you press V M $, it will prompt for an argument list, being (x) the default. It will then apply the function to all the elements in the vector.

Note: The order is important, first the vector, then the function.

For more information visit: the documentation.

2
  • 2
    That is indeed the relevant piece. It says: If you press $ at the operator prompt, the effect is similar to the apostrophe except that the relevant formula is taken from top-of-stack instead. The actual vector arguments of the V A $ or related command then start at the second-to-top stack position. You will still be prompted for an argument list.
    – NickD
    Commented Sep 13 at 1:26
  • Oh, I see. I was trying V M ' $. By prompt I understood V M ''s prompt. Thanks Nick! I'll edit the question accordingly. Commented Sep 13 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.