d_nikolaos Posted October 28, 2008 Report Share Posted October 28, 2008 Hi, I am trying to add the numbers of a table. Is that possible? Moreover I want to ask if there is any function that counts how many are the numbers of the table. Quote Link to comment
Francois Normandin Posted October 28, 2008 Report Share Posted October 28, 2008 QUOTE (d_nikolaos @ Oct 27 2008, 02:36 PM) Hi,I am trying to add the numbers of a table. Is that possible? Moreover I want to ask if there is any function that counts how many are the numbers of the table. There's a "Add Array Elements" in the Numerics Palette. It is polymorphic and will add your table easily. For counting the elements of an array, look at the array palette. The first icon is ArraySize. Look up the context help (Ctrl-H) for these functions to get more info. Quote Link to comment
d_nikolaos Posted October 28, 2008 Author Report Share Posted October 28, 2008 The Array size works fine for me but the Add arrays elements doesn't work. I want to add all the numbers of table 2 ( Squer of table 1) and then divide this number with the number of array size. I read some numbers from a xls file. Here is the Vi. Quote Link to comment
Francois Normandin Posted October 28, 2008 Report Share Posted October 28, 2008 QUOTE (d_nikolaos @ Oct 27 2008, 03:53 PM) The Array size works fine for me but the Add arrays elements doesn't work.I want to add all the numbers of table 2 ( Squer of table 1) and then divide this number with the number of array size. I read some numbers from a xls file. Here is the Vi. A table is a String 2D Array. You need to convert to Numerical 2D Array. Check out the "String>String/Number Conversion" Palette. Quote Link to comment
d_nikolaos Posted October 28, 2008 Author Report Share Posted October 28, 2008 Thank you very much for your help This is my final VI Quote Link to comment
Francois Normandin Posted October 28, 2008 Report Share Posted October 28, 2008 QUOTE (d_nikolaos @ Oct 27 2008, 05:08 PM) Thank you very much for your helpThis is my final VI You're welcome. I see you've used "Decimal String to Number" instead of "Fractional String to Number". Do you have only integers in your file? If you have floats, you're going to lose precision in the conversion... Quote Link to comment
d_nikolaos Posted October 28, 2008 Author Report Share Posted October 28, 2008 Yes, I only have integers. I thought that it was the same. Is it better to use "Fractional String to Number"? I just check it and it has the same result. Quote Link to comment
Francois Normandin Posted October 29, 2008 Report Share Posted October 29, 2008 QUOTE (d_nikolaos @ Oct 27 2008, 06:07 PM) Yes, I only have integers. I thought that it was the same.Is it better to use "Fractional String to Number"? I just check it and it has the same result. If you've got only integers, then you selected the right one. They are not the same... ex: 3.14 string converted using Fractional String will give 3.140000, and you'll get 3 if using Decimal String. It's a common mistake in ANY programming language! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.