Get Help

Turn on suggestions

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
- :
- Re: Interpolation data

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

02-21-2020
04:37 PM

02-21-2020
04:37 PM

Hi everyone.

I have a little problem with an interpollation data. When i start to use cspline the program give return error "The elements in this vector must be in ascending order."

Mathcad 14.

P.S. Sorry for bad english.

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

02-22-2020
04:37 AM

02-22-2020
04:37 AM

Looks like you posted an empty worksheet !?

When using spline interpolations, the values in the first vector ("x-values") must be in ascending order to make the interpolation work. As you get the error message you describe they obviously aren't all in that order.

4 REPLIES 4

Highlighted

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

02-22-2020
04:37 AM

02-22-2020
04:37 AM

Looks like you posted an empty worksheet !?

When using spline interpolations, the values in the first vector ("x-values") must be in ascending order to make the interpolation work. As you get the error message you describe they obviously aren't all in that order.

Highlighted
##

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

02-22-2020
05:39 AM

02-22-2020
05:39 AM

Re: Interpolation data

The worksheet start with second page. Values in the vector is ascending.

Highlighted
##

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

02-22-2020
07:08 AM

02-22-2020
07:08 AM

Re: Interpolation data

@mctraila wrote:

The worksheet start with second page.

Tricky 😉

The problem in your sheet is, that you obviously are not aware, that by default the first index number of a vector is 0, not 1.

You created your vectors using a range variable j starting at 1. But the vectors you created that way also have an element with index 0 (by default has the value 0) and as the first value in your vector i is 0, too, the first two elements are both 0 and thats not strictly ascending.

Two possible solutions:

1) Define j as j:=0 .. 11

or

2) Write ORIGIN:=1 at the top of your sheet (alternatively you may set the value of the system variable ORIGIN via the menu -> Tools -> Worksheet Options -> Built-In Variables -> Array Origin(ORIGIN)->1).

For the screenshot below I used option 2

Highlighted
##

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

02-22-2020
07:14 AM

02-22-2020
07:14 AM

Re: Interpolation data

Thank you