Quantcast
Channel: PTC Community : All Content - Programming & Extending Mathcad
Viewing all articles
Browse latest Browse all 680

submatrix variants ...

$
0
0

Whilst the built-in submatrix is adequate for most of my purposes, I often have cases where I want to either pick elements in a more arbitrary fashion (eg, a list of indices from a filter function) or have non-contiguous blocks (eg, every other column or row).   I also occasionally want to reference the indices from the end of a row or column rather then their starts, but don't want to go to the trouble of calculating the adjusted indices.

 

In addition, I'm quite lazy and don't really see why I should go to all the trouble of typing out zeros for the column indices when all I want is the elements of a vector (I also think it makes it slightly harder for others to intepret).

 

Consequently, I have written a couple of variants of submatrix that extend its capabilities by allowing end-relative addressing and non-contiguous data, including vector counterparts of each function.   The attached M15 worksheet contains the definitions of these functions plus some examples showing their use.

 

Comments / improvements / alternatives welcome! 

 

Stuart


Viewing all articles
Browse latest Browse all 680

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>