10-17-2012 06:35 PM
I am wanting to generate a matrix using the attached data so that x is row 1 and y is column 1. I tried splitting the array and using build array however It didn't work. I've checked the forums but no luck. any insight would be appreciated
Solved! Go to Solution.
10-17-2012 07:10 PM - edited 10-17-2012 07:21 PM
@matthewk wrote:
I am wanting to generate a matrix using the attached data so that x is row 1 and y is column 1. I tried splitting the array and using build array however It didn't work. I've checked the forums but no luck. any insight would be appreciated
I assume that you probably meant: Column 1 is x, Column 2 is y, and column 3 is the value at cell x,y.
All you need is initialize an array of the proper size, keep it in a shift register, and then replace values in order. Here's a quick draft. You can easily swap rows and columns if needed.
Of course negative indices are not allowed, so you need to create a proper offset such that the lowest index is zero. You could display it in an intensity graph and set the axis offsets accordingly.
I simply pasted the excel data into a text diagram constant. You can save the excel file as tab delimited text, then use "read from spreadsheet file".
10-17-2012 08:35 PM
Alenbach,
Thank you so much for the help. Unfortunately I'm not sure what you used to split the array
10-17-2012 10:58 PM
"Index array" resized for three outputs. If you have a 2d array, leaving the bottom index unwired gives you a row and leaving the top index disconnected gives you a column. Wiring both indices gives you an element. Check the online help.
My picture above is a snippet. Drag it to the diagram (LabVIEW 2012) and it will turn into runnable code.
10-18-2012 02:52 PM
Altenbach,
Works great. Thanks for all the help. I learned a lot
K
10-18-2012 03:02 PM
Then you should mark Altenbach's message as the solution to your problem rather than your own thank you message to give credit where credit is due.
First you will have to go to the options menu to the upper right of your message and pick "unmark as solution".