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
- :
- Matrix Search using Array Vector in Prime 3.1

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-22-2016
03:32 PM

11-22-2016
03:32 PM

Matrix Search using Array Vector in Prime 3.1

Hi,

I was looking for a way of easily searching a data matrix "lookup table" with an array vector to extract a value for use in later calculations. I've seen a post where a single value is used to extract a row of data (I need to extract one row of a matrix) and was wondering if this can be somehow extended to be an vector array to extract a single value "alpha". A nominal array and the proposed data matrix would be similar to that below. I've attached a worksheet if that assists?

Also saw this Build New Matrix by Selecting Specific Columns of Another Matrix maybe this has potential to offer an alternate way of extracting the row then alpha value using this as an approach, cant quiet get my head around the matrix math to see a way through...

Thanks in advance

Message was edited by: Peter Darby

Labels:

6 REPLIES 6

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

11-22-2016
08:42 PM

11-22-2016
08:42 PM

Re: Matrix Search using Array Vector in Prime 3.1

Maybe you are looking for something like this:

Some rudimentary error handling implemented.

If the last argument is a valid column header, just the value(s) in that column are returned, otherwise the full rows.

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

11-23-2016
04:13 PM

11-23-2016
04:13 PM

Re: Matrix Search using Array Vector in Prime 3.1

Hi Werner,

Many thanks, I'm currently thinking my way through the method supplied - the matrix math its relatively new so it might take a couple of goes to absorb it. The error handling is good, till now hadn't thought much about that.

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

11-24-2016
05:45 PM

11-24-2016
05:45 PM

Re: Matrix Search using Array Vector in Prime 3.1

Peter Darby wrote:

Hi Werner,

Many thanks, I'm currently thinking my way through the method supplied - the matrix math its relatively new so it might take a couple of goes to absorb it. The error handling is good, till now hadn't thought much about that.

I tried to provide a more general utility which works for any header expressions and any type of table values. That way it looks (and is) more complicate.

Feel free to come back and ask if you experience any confusion.

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

11-24-2016
08:47 PM

11-24-2016
08:47 PM

Re: Matrix Search using Array Vector in Prime 3.1

Hi Werner,

Appreciate the solution you provided - I'm relatively new to the matrix style math in MathCad it seems to have a lot of power. Thinking through your approach really helps to get an understanding and how to apply. So all good - thanks.

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

11-23-2016
10:11 AM

11-23-2016
10:11 AM

Re: Matrix Search using Array Vector in Prime 3.1

How about this?

For clarity, here are the values of LookupVector and MatchValue:

This is shown in Mathcad 15, but I believe everything would be the same in Prime.

You could also turn this series of calculations into a program for ease of use.

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

11-23-2016
04:17 PM

11-23-2016
04:17 PM

Re: Matrix Search using Array Vector in Prime 3.1

Hi Mark,

Thanks, like the concat - it really strips down the logic - I'll try it in prime and see how it goes.