Jump to content

Table Sum


Recommended Posts

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.

Link to comment

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.

Link to comment

QUOTE (d_nikolaos @ Oct 27 2008, 05:08 PM)

Thank you very much for your help

This 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...

Link to comment

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. :yes:

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!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.