Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Deleted
The answer to your question:
Because x/a is a scalar when f(x,a) is called through a plot and you cannot compare a scalar with a range.
Success!
Luc
Here are my 2 cents worth
How can be made for this @ttokoro
An how to see when, at what position x/a=0.5, 1, 1.5, 2, etc... as there are 10000 elements...
mod condition does not match. So return no data. Not last(x) but last(p). Add else condition.
@ttokoro wrote:
mod condition does not match. So return no data.=
But how to check this does not match?
For example lets say that we have this vector:
And I want to see how many elements are equal with 0.5 for example and at which indexes the elements are located:
And if there are no any elements in the vector equal with 0.5 to have as a result that something like: "There are no elements equal with 0.5 in this vector" or something like this.
We can take firstly other example (more simple and maybe more intuitive) like this below vector and then to move for the above vector (x/a).
Let's say that we have this below y vector:
And I want to know:
1. If any elements from this vector are equal with 0.5
2. At which indexes there are located those elements in the vector
Look up the "match" command in the help!
At least if you mean what you wrote - just looking for the exact value 0,5.
If you are looking for integer multiples of 0,5 (0.5, 1, 1.5, etc.) you would also add the mod command.
Only change the condition.
And if you want the line number of the match data, just set the answer with index i.
You are filtering the p-values which are integer multiples of 0.5.
I may be wrong, but as I understood @Cornel wanted to filter for the x-values where x/a is an integer multiple of 0.5.
Your function does not make use of its argument a in any way!?
On contrary to what he asked first in his last posting he wanted to see the values of x which are 0.5 (not multiples).
So actually I am not sure what he really is looking for ...