cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Plotting failed when defining with inequality

Cornel
19-Tanzanite

Plotting failed when defining with inequality

Hi,

Why is not possible to plot like below?

Cornel_0-1712043765628.png

 

ACCEPTED SOLUTION

Accepted Solutions
ttokoro
20-Turquoise
(To:Cornel)

10 REPLIES 10
ttokoro
20-Turquoise
(To:Cornel)

image.pngimage.pngimage.pngimage.png

Deleted

LucMeekes
23-Emerald III
(To:Cornel)

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

Werner_E
25-Diamond I
(To:Cornel)

Here are my 2 cents worth

Werner_E_1-1712154014875.png

 

Cornel
19-Tanzanite
(To:Werner_E)

How can be made for this @ttokoro 

Cornel_2-1712222750930.png

 

Cornel_7-1712222933883.png

 

Cornel_4-1712222777468.png

An how to see when, at what position x/a=0.5, 1, 1.5, 2, etc... as there are 10000 elements...

Cornel_5-1712222836773.png

Cornel_6-1712222857080.png

 

 

 

ttokoro
20-Turquoise
(To:Cornel)

mod condition does not match. So return no data. Not last(x) but last(p). Add else condition.

 

image.pngimage.pngimage.png

Cornel
19-Tanzanite
(To:ttokoro)


@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:

Cornel_0-1712228847232.png


And I want to see how many elements are equal with 0.5 for example and at which indexes the elements are located:

Cornel_1-1712228925669.png

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:

Cornel_2-1712229035872.png

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

Werner_E
25-Diamond I
(To:Cornel)

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.

ttokoro
20-Turquoise
(To:Cornel)

 

Only change the condition.

image.pngimage.png

And if you want the line number of the match data, just set the answer with index i.

image.png

Werner_E
25-Diamond I
(To:ttokoro)

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 ...

Announcements

Top Tags