• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. passing variable for plot expression in plot() COMMAND

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 142
  • Views 14189
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

passing variable for plot expression in plot() COMMAND

RFStuff
RFStuff over 5 years ago

Dear All,

I want to pass  a variable for wave expression in plot() .

The below command gives the wave name as waveName

plot(drCreateWaveform(drCreateVec('double xList) drCreateVec('double yList)) ?expr '("waveName") )

If I want to pass a variable to ?expr '(" "), how it can be done ?

Kind Regards,

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Use list() rather than '(). So:

    waveName="RFStuff"
    plot(drCreateWaveform(drCreateVec('double xList) drCreateVec('double yList)) ?expr list(waveName))

    The quote function prevents its arguments from being evaluated, so you just need to use list instead (which will evaluate all of its arguments, like most functions do).

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Use list() rather than '(). So:

    waveName="RFStuff"
    plot(drCreateWaveform(drCreateVec('double xList) drCreateVec('double yList)) ?expr list(waveName))

    The quote function prevents its arguments from being evaluated, so you just need to use list instead (which will evaluate all of its arguments, like most functions do).

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • RFStuff
    RFStuff over 5 years ago in reply to Andrew Beckett

    Thanks Andrew.

    Suppose my list  is MY_LIST=list("RFStuff" "Andrew")

    In first iteration of plot (in a for loop say)  it should be passed as "RFStuff".

    In the second iteration  it should be passed as "Andrew".

    How this can be achieved here ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to RFStuff

    foreach(waveName MY_LIST
      plot(... ?expr list(waveName))
    )

    would do what you want. Maybe you want something like this?

    xData=list(
      list(1 2 3)
      list(1 2.4 4 5.6)
    )

    yData=list(
      list(2.0 1.4 5.2)
      list(-1.2 3.4 8.7 7.2)
    )

    MY_LIST=list("RFstuff" "Andrew")

    foreach((xList yList waveName) xData yData MY_LIST
      plot(drCreateWaveform(drCreateVec('double xList) drCreateVec('double yList)) ?expr list(waveName))
    )

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RFStuff
    RFStuff over 5 years ago in reply to Andrew Beckett

    Thanks a lot Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information