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
- :
- How to access non-sequential array indices

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

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

11-26-2013
11:06 AM

11-26-2013
11:06 AM

Sorry if this has been answered before. I have looked around for the last hour or two and can not seem to find anything about this. I've created my own function to solve this issue, but I can't help but think that it should be easier.

I would like to access an array with another array of indices. Unlike a range, these indices are non-sequential. When I try to access the array just like a range would, it says that the value must be an integer. I've also tried vectorizing it, to no avail.

Any insight you guys might have would be greatly appreciated. I'm using Mathcad Prime 2.0, by the way.

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

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

11-26-2013
11:58 AM

11-26-2013
11:58 AM

What do you mean by "access" the first array? Selecting a subset of data values in the first vector given by another array of indices?

If yes, here are two possible solutions:

3 REPLIES 3

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

11-26-2013
11:58 AM

11-26-2013
11:58 AM

What do you mean by "access" the first array? Selecting a subset of data values in the first vector given by another array of indices?

If yes, here are two possible solutions:

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

11-26-2013
12:27 PM

11-26-2013
12:27 PM

Re: How to access non-sequential array indices

That's exactly what I was looking for! Thank you!

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

11-26-2013
01:01 PM

11-26-2013
01:01 PM

Re: How to access non-sequential array indices

You are welcome.

Here is a third way using a local function and vectorization: