Get Help

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Summing large tables

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-03-2013
12:27 PM

06-03-2013
12:27 PM

I'm trying to process a set of data that I have for limits generation. I am using MathCad to validate some limit generation algorithms that we will be using in a software tool that we are developing (no relation to Mathcad).

So, I have a problem:

The summation function only seems to work on matrixes and tables of less than a certain size:

If I define y_n to be a subset of the tables that I have, I get a summation. But if I try to sum an entire column, I get the error you see.

I have tried using a for loop to manually sum the elements of the table, but I get the same result as above. I will also get an error if I set the range variable n (in the screenshot above) to be 0...20 (or greater).

What am I doing wrong?

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-04-2013
02:41 AM

06-04-2013
02:41 AM

Valery, the problem is not the way how to sum up. It works the way Jeff had done, too.

It looks like one of the elements in Jeff's matrix is a string or a matrix instead of a scalar and that throws the error.

8 REPLIES 8

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-03-2013
01:53 PM

06-03-2013
01:53 PM

Re: Summing large tables

May be so (ORIGIN=0):

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-03-2013
02:00 PM

06-03-2013
02:00 PM

Re: Summing large tables

I'm not trying to sum all elements of the matrix. I am trying to sum any given column of the matrix (which is very large). It appears that when the matrix is larger than a given size that the summation will not work. You should see this if you made your matrix more than 19 elements in either dimension.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-04-2013
12:27 AM

06-04-2013
12:27 AM

Re: Summing large tables

Jeff Lambert wrote:

I am trying to sum any given column of the matrix (which is very large).

I am trying to sum **elements** (?) any given column of the matrix (which is very large).

Sorry I do not see a problem. One more variant of solution.

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-04-2013
02:41 AM

06-04-2013
02:41 AM

Valery, the problem is not the way how to sum up. It works the way Jeff had done, too.

It looks like one of the elements in Jeff's matrix is a string or a matrix instead of a scalar and that throws the error.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-04-2013
02:58 PM

06-04-2013
02:58 PM

Re: Summing large tables

Yeap, that was the problem. I didn't notice that when I exported the data from Excel into the text format that I used that some of the data had "m" in it to specifify milli-dB. Now it's fixed and the summation works as expected!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-03-2013
03:41 PM

06-03-2013
03:41 PM

Re: Summing large tables

Its hard to impossible to debug a mere picture!

You should attach the worksheet or, if thats not possible as of sensible content, you should create and attach a dummy worksheet, showing the same error.

You can attach sheets

There is no limit in respect to vector/matrix sum and it should work (and does for me) the way you had set it up. And a matrix of the dimensions you are dealing with wouldn't be called large.

Best guess is that in your first column in a row with an index greater than 19 there is an element which is not a scalar value, probably a textstring or a matrix (maybe just a 1x1 matrix). From the description of your problem you should have a look at the element GainResponse[20,0.

How are the values for you matrix are generated? Is there some kind of symbolic solve or find involved? This could find more than one solution for a specific combination of parameters and so the result would be a column or row vector and not a single scalar.

Or maybe the data is read from an external file and the element happened to be interpreted as text instead as scalar number.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-03-2013
05:51 PM

06-03-2013
05:51 PM

Re: Summing large tables

The problem is that I cannot just upload the worksheet because it references external files with confidential data (as Werner has suspected) that is being loaded with the file import function.

I will check this tomorrow as well as find another way to upload the worksheet if I cannot get this to work.

Thanks for the suggestions so far!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-04-2013
02:47 AM

06-04-2013
02:47 AM

Re: Summing large tables

Have a look at the attached. I have used a couple of user defined functions and it works for over 20 elements.

Mike