Is there a function to get the curve index of the last point of a curve?

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

I want to use some templex functions for notes and text boxes that extract values from curves, such as the peak value and final value. For the peak, I can use the indexofmax(curve.id) function. Is there a similar one to get the final point? I wasn't able to find a similar command in the help.

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2007

    I have not try it but how about using the next templatex function:

    {max(p1w1c1.x)}

    p1 = page 1

    w1 = window1

    c1 = curve 1

    this should give the max value in the X axis.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2007

    The {max(p1w1c1.x)} function will give the maximum value of the x curve, but not the index number. However, I realized that I could just use the indexofmax(p1w1c1.x) rather than .y to get the index of the largest X value, rather than for the peak Y value.

    Thanks for idea though Cesar - it did get me to the right answer.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2007

    mmhh, feels like I just did 'a homer' hehe!

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2007

    You can find the index of the last point by using the following statement:

    {numpts(p1w1c1.y)-1}

    Regards,

    Liz