Is there a better way to create a 1D array with n number of elements in LabVIEW?

泄露秘密 提交于 2019-12-24 17:18:09

问题


Here is what I did, anyone have a better way of doing it?

Do they have built-in function to do this? I just started using LabVIEW might have overlooked. Like in MATLAB its just:

    x = (0:10-1)

and in Python:

    x = range(10)

回答1:


The easiest way to create a range, is to do as you've done - but wire the indexing terminal directly and dropping the shift register. There is no built-in way to do this. The only potential gain of that would be to use slightly less space on the diagram.

Edit: As Yair pointed out, there is a built-in way to do this in the form of the ramp pattern. That VI has much more configurability, for example choosing between divide range into N samples or by delta. It does require the full development license however (in the signal processing palette).




回答2:


oysstu's solution is certainly good, and it's what I do in the rare cases where I actually need data like this. Another option is the ramp pattern VI which hides somewhere in the palettes and allows some more complex ranges.



来源:https://stackoverflow.com/questions/30932089/is-there-a-better-way-to-create-a-1d-array-with-n-number-of-elements-in-labview

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!