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 limit the size of a matrix in Mathcad

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

04-23-2013
10:12 PM

04-23-2013
10:12 PM

Hello,

I am trying to limit the size of a 10x10 matrix depending on a given variable, for example (n). The 10x10 matrix is the basic matrix with all numbers in it.

(n) is going to be any number from 0 to 10. for instance, if I put n=6, the matrix is going to be 6x6 with its numbers coming from the 10x10 matrix.

To be more clear, if I have this matrix which is 10x10 ( the basic matrix) with all its variables are given:

K=[ k1+k2 -k2 0 0 0 0 0 0 0 0 ;

-k2 k2+k3 -k3 0 0 0 0 0 0 0 ;

0 -k3 k3+k4 -k4 0 0 0 0 0 0 ;

0 0 -k4 k4+k5 -k5 0 0 0 0 0 ;

0 0 0 -k5 k5+k6 -k6 0 0 0 0 ;

0 0 0 0 -k6 k6+k7 -k7 0 0 0 ;

0 0 0 0 0 -k7 k7+k8 -k8 0 0 ;

0 0 0 0 0 0 -k8 k8+k9 -k9 0 ;

0 0 0 0 0 0 0 -k9 k9+k10 -k10 ;

0 0 0 0 0 0 0 0 -k10 k10]

If I put n=3, the matrix will be 3x3 coming from the 10x10 matrix (the basic matrix):

K=[ k1+k2 -k2 0 ;

-k2 k2+k3 -k3

0 -k3 k3+k4]

Thank you in advance.

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

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

04-23-2013
11:08 PM

04-23-2013
11:08 PM

extract(M,n):=submatrix(M,0,n-1,0,n-1)

2 REPLIES 2

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

04-23-2013
11:08 PM

04-23-2013
11:08 PM

extract(M,n):=submatrix(M,0,n-1,0,n-1)

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

04-24-2013
03:23 PM

04-24-2013
03:23 PM

Re: How to limit the size of a matrix in Mathcad

That works.

Thanks alot.