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: Entering one matrix(3x3) into another larger m...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-25-2017
05:29 PM

10-25-2017
05:29 PM

Entering one matrix(3x3) into another larger matrix(21x21)

Hello,

Say I have a matrix called Y that is (21x21) and I have matrix A that is (3x3). I would like to have matrix A placed in Y starting at Y1,1 so that

Y11=A11

Y12= A12

Y13=A13

Y21=A21

Y22=A22

Y23=A23

Y31=A31

Y32=A32

Y33=A33

I am new to using mathcad, thanks for the help.

Labels:

7 REPLIES 7

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

10-25-2017
06:55 PM

10-25-2017
06:55 PM

Re: Entering one matrix(3x3) into another larger matrix(21x21)

Hi,

Prime 4 and MathCad implementation

Arrays start index is 0 by default, to establish Y as a 21x21 matrix, set the last element to zero.

Enter an arbitrary A matrix.

Set up two range variables to operate over the matrices.

Using the range variables enter A into Y at correct location.

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

10-25-2017
07:03 PM

10-25-2017
07:03 PM

Re: Entering one matrix(3x3) into another larger matrix(21x21)

I assume you want 1,1 to be the origin of the array, in which case you should be aware that in Mathcad the default origin is 0,0. You can chnage it to 1,1 though.

Given that, you can do what you ask using a couple of range variables:

if that does not solve your problem, then we need more infomation about what you wish to do.

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

10-25-2017
08:04 PM

10-25-2017
08:04 PM

Re: Entering one matrix(3x3) into another larger matrix(21x21)

and if you were to place the A matrix in the middle of your 7x7?

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

10-25-2017
08:21 PM

10-25-2017
08:21 PM

Re: Entering one matrix(3x3) into another larger matrix(21x21)

example...

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

10-26-2017
09:44 AM

10-26-2017
09:44 AM

Re: Entering one matrix(3x3) into another larger matrix(21x21)

Personally I would prefer using a small utility routine to do the job. Especially if you need to do it more than once and for different insert positions.

Here is a quick hack. Its ORIGIN aware, so you can use it without changes in a sheet which hast ORIGIN set to 1 instead od the default 0. But the routine lacks error checking - e.g. for wrong indices. If you provide an insertion index which is lower than ORIGIN, you will get an errror from Mathcad. If you provide an insertion index which is to big, then the resulting matrix will be extended and the new positions filled with zeros. In the example, Insert(A,Y,19,20) will result in a 22 x 23 matrix instead of the 21 x 21. You would have to state what should happen in this case. Either an error message or inserting A only partial so that the result is still 21 x 21.

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

10-26-2017
12:44 PM

10-26-2017
12:44 PM

Re: Entering one matrix(3x3) into another larger matrix(21x21)

Then, using Richard's method, you would write the expression ZAn+2,m+2:=An,m

Success!

Luc

Highlighted
##

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

10-26-2017
01:45 PM

10-26-2017
01:45 PM

Re: Entering one matrix(3x3) into another larger matrix(21x21)

Here are some variants with rudimentary error checking:

Top Tags