06-17-2009 09:50 AM
i need to generate an array 2D, why appears that error?
thanks in advance
06-17-2009 09:53 AM
What exactly are you trying to do?
That looks way more complicated than it should be.
06-17-2009 10:01 AM
06-17-2009 10:05 AM
Instead of using a sequence structure and several local variables,
why dont you just use 'build array' wired to a shift register.
This will build your 1D arrays into a 2D array.
06-17-2009 10:06 AM
06-17-2009 10:06 AM
Are you just trying to initialize a MxN array of empty strings?
06-17-2009 10:10 AM
If you just need to initialize a 2D array, then your code is way, way, way too Rube Goldberg. You can use the Initialize Array function to directly create a 2D array or simply use a block diagram constant if you want a blank array. You could also dynamically create the 2D array as mentioned with the Build Array and you append the 1D data.
I would suggest you take some of the basic LabVIEW tutorials.
06-17-2009 10:16 AM - edited 06-17-2009 10:17 AM
Hi kashfer,
I hope your well today and thanks for the post.
You've had some good advise - here is an image.
I have to admit though - Rube Goldberg certainly.
I hope this helps, and have you spoken to your local sales office about LabVIEW training?
06-17-2009 10:19 AM - edited 06-17-2009 10:25 AM
kashfer wrote:i need to generate an array 2D, why appears that error?
This is code is extremely convoluted and wrong. You seem to have a 1x1 subset with a single element that you want to insert.
All you probably need is "initialize array" with that single element (obtained via "index array", not "array subset"!), and the final
dimensions wired. No loops needed.
With every iteration, you reinitalize the "5" array back to a size 0x0 array, throwing away anything you did in previous iterations!
Except at the first iteration, you will try to insert into an index that does not even exist in the 2D array, an impossible operation.
Can you attach your code so we can have a look at the entire context?
Here's seemingly equivalent code:
06-17-2009 10:25 AM
Hi,
Instead of array subset, you probably need index array. The output of array subset is also an array (although there is only one element) not a scalar. By the way, your vi is overly complicated and may not do what you want. If you need to convert a 1-D array to a 2-D array, try reshape array function. Good luck.