Forum FlexPro – Discuss your topic!

How to multiply x axis by constant?

Home > Community > General > How to multiply x axis by constant?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Autor
    Beiträge
  • #12588
    Richard SmithRichard Smith
    Teilnehmer

    If I create a function where I multiply a signal dataset by a constant this multiplies the Y axis values.

    How to I do the same but multiply only the X axis (for instance time) values?

    Thanks.

    #8251
    Richard SmithRichard Smith
    Teilnehmer

    If I create a function where I multiply a signal dataset by a constant this multiplies the Y axis values.

    How to I do the same but multiply only the X axis (for instance time) values?

    Thanks.

    #8942
    Bernhard KantzBernhard Kantz
    Teilnehmer

    Use the following FPScript code:

    
    Dim factor = 2.0
    Signal(data.Y, data.X * factor)
    

    In this example data is the signal name.

    support@weisang.com

    #8943
    Richard SmithRichard Smith
    Teilnehmer

    Thanks for the reply.

    I tried this solution and it works perfectly, however, I am wondering what the “Dim factor = 2.0” does because also just tried “Signal(signalname.Y, signalname.X * factor” by itself that also works perfectly.

    Thanks.

    #8944
    Bernhard KantzBernhard Kantz
    Teilnehmer

    Both notations are possible. The Dim statement declares a local variables and assigns a value to it. But you’re right. In this simple example you don’t need to use this variable.

    support@weisang.com

Viewing 5 posts - 1 through 5 (of 5 total)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.