ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
There are many times when I need to grab the last element or last n elements of an array. This usually involves a call to Array Size and then a subtraction, costing me time and block diagram clutter. Array reversal is essentially free, but again costs clutter and clicks. For common array types I have personal VIs to do the job, but that is just a band-aid with the proliferation of data types that I use. My idea would be to treat negative values input to the index array or array subset VIs (for example) as counting from the end of the array. The last value would have index -1 and so on. To get the last n values I would put -n into the Array subset VI and that's it. For expanding the Array Index VI, my preference would be that it counts down (-2,-3,-4,...).
只有注册用户才能在此添加评论。 如果您已经注册,请登录。 如果您还没有注册,请注册并登录。