LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dividing row wise in a 2d array

hi all

 

I have a 2d array I would like to split the first row and then divide the first row from all other rows of the array one to one.........like divide first element of first row with all the elements of first column of array, second element of first row wth all the elements of second column of array and likewise .plz help me

 

 

0 Kudos
Message 1 of 9
(4,442 Views)

maybe something like this?

Message Edited by altenbach on 08-21-2008 09:25 AM
Message 2 of 9
(4,434 Views)

Hi

 

I have produced this simple bit of code in LV8.5.

 

Let me know what you think.

 

Regards,

 

*I have just seen the result from before - maybe I misunderstand what you were trying to do. If I have, sorry.

Message Edited by Hillman on 08-21-2008 05:30 PM
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 3 of 9
(4,429 Views)
hi.....i am using earlier version of LabView ......so cudnt open that vi. cud u just send me the snap shot of the vi if possible so that i cud try it out
0 Kudos
Message 4 of 9
(4,391 Views)
I worked out the problem through another method. I created another 2d array with all rows same as that of the first row of the initial array which had to be divided for. Its woring. Thanks for al ur suggestions.
0 Kudos
Message 5 of 9
(4,385 Views)

Hi

 

Here you go.

 

Regards,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 6 of 9
(4,380 Views)

Sorry, but I don't think Hillmann's solution is correct. It is also extremely convoluted and overly complicated. Starting with a 2D array, his solution is an array with a single column, which I don't think is what you want.

 

Some things that struck me oddly in Hillmann's solution:

  1. Why use split array and get an array with a single element? "index array" would be more reasonable to get the first element and use "array suset" for the rest.
  2. I have no idea why you would use 2 sequential FOR loops. The two outer loops can be combined into one, eliminating the need to allocate the 2D arrays between the two loops.
  3. The second "split array" does not change anything. We start with an array of one element and output the same. Why???
  4. Again why carry an array with one element in the shift register. A scalar would be more approriate.

04998285626, could you  explain once more what kind of output do you actually want. I am pretty sure my solution is close. You might need to remove the first row of the output or swap the inputs of the divide node.

 

Lets say the array is:

 

  1  2  3

  4  5  6

  7  8  9

 

What would be the correct solution you want?

Message 7 of 9
(4,370 Views)

hi.....

 

I tried hilman's approach. Its not the exact solution that I wanted. Altenbach's solution is working fine for the problem that I posed. Thats what I exactly want . Anyway I have carried it out in another way as mentioned in my earlier reply....thanks all for ur response

0 Kudos
Message 8 of 9
(4,364 Views)

Hi,

 

I am sorry for the code I sent - my replies are normally better than that. I also felt I miss-understood what you wanted.

 

Happy Labviewing.

 

Regards,

Message Edited by Hillman on 08-27-2008 11:59 AM
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 9 of 9
(4,310 Views)