Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
If i have a vector A=(0.45, 1.78, 0.82, 0.95, 1.99, 1.12, 0.77), how to create a vector B that contains only B=(0.45, 0.82, 0.95, 0.77); only values that are lower than 1. The other values may be 0 for example.
Solved! Go to Solution.
Really?
But is number 3 in this case considered as the second number or third number of the matrix? Because the output of the matrix must be with the same number of elements. I need them to be connected with some other vectors.
?
"3" is the second number in the vector.
Your example shows a vector B that is shorter than A. That's what my (and Fred's) function provides.
Please specify more carefully and exactly what you want.
Luc
Is it possible that i get a text instead of a number? For example: "Not applicable"
Sorry for my amateur question. 😕
What is your criterion for 'Not applicable'.?
Luc
If any value is bigger than 1 in vector A, i want the result on vector B for that number to be "Not Applicable"
Like this?
Exactly . Thank you very much to you, LucMeekes and Fred.
Here's another approach:
I have one more problem. Lets say i have vector B that you created and vector C=(4, 9, 19, 2, 11, 19, 55). I need to create vector D that is: if the value in B is NaN, also D to be NaN, if the value in B is number(lower than 1 in this case), the result in D must be the value from C.
You may also use
D:=IF(A<1, C,NaN) (vectorized, of course)
so you would not need to calculate B first.
Drilon Shabani wrote:
If i have a vector A=(0.45, 1.78, 0.82, 0.95, 1.99, 1.12, 0.77), how to create a vector B that contains only B=(0.45, 0.82, 0.95, 0.77); only values that are lower than 1. The other values may be 0 for example.
If 0 is OK (instead of NaN or "n.a.") you may simply use this vectorized statement:
In Prime . . . You could just use the lookup function...... like this . . . much simpler