Again its not really clear what exactly you expect as result and giving one or two examples would have helped.
In the following approach I assumed that you want a vector with the values of KP but replace the original value if the value in F at the corresponding position is negative.
Here is a short approach using vectorization

We can use a table built with augment to check the results

And here is a more "natural" approach with a function using a for loop

You can replace the 0m by NaN or whatever may be appropriate.
We can check if both ways return the same result

Using the if-function we can write it less space consuming

One may think that we could simply vectorize that if-function
![]()
but this does not work
![]()
because Prime does not allow to vectorize comparison operators like the < directly, but we are allowed to vectorize a function which uses the comparison:
![]()
![]()
Prime 9 worksheet attached
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.


