Replacing values within a vector using the Script element

Comments

2 comments

  • Official comment
    Avatar
    Rick Kossik

    This is very easy to do and does not require a script. It simply requires a single Expression.  If your vector is named, for example, Vector1, then simply create an Expression that looks like this and it will set all negative values to 0: vector(if(Vector1[row]<0,0,Vector1[row]))

    You can read about the "row" variable here: https://help.goldsim.com/default.htm#GS/definingarraysinaninputfieldusingarrayconstructorfunctions.htm

    Comment actions Permalink
  • Avatar
    Jackson White

    Thanks Rick! It's all running now. 

    0
    Comment actions Permalink

Please sign in to leave a comment.