Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
As an extension to Valery's Mathcad Prime Minister (Submatrix and Subvector), I'd like to propose the following extensions to Mathcad's subarray functions (unfortunately, I can't post worksheets to Valery's PM thread, otherwise I'd have posted this there).:
The new submatrix function interprets negative indices as counting from the end of an array (ie, -1 == last row or column index). The functions subvector (which has been in my library for a long time) is simply a specialized form of the new submatrix (a variant of which I've also used for a long time). I've also included the functions firstrows, lastrows, firstcols, lastcols, rowends, colends and matends. The first 4 are hopefully suggestively named. The latter 3 are intended to provide a compact view of the first and last few elements of an array (I often find it convenient to look at the first and last values of an array calculation).
Stuart
StuartBruff wrote:
As an extension to Valery's Mathcad Prime Minister (Submatrix and Subvector), I'd like to propose the following extensions to Mathcad's subarray functions (unfortunately, I can't post worksheets to Valery's PM thread, otherwise I'd have posted this there).:
The new submatrix function interprets negative indices as counting from the end of an array (ie, -1 == last row or column index). The functions subvector (which has been in my library for a long time) is simply a specialized form of the new submatrix (a variant of which I've also used for a long time). I've also included the functions firstrows, lastrows, firstcols, lastcols, rowends, colends and matends. The first 4 are hopefully suggestively named. The latter 3 are intended to provide a compact view of the first and last few elements of an array (I often find it convenient to look at the first and last values of an array calculation).
Prime 3.1 and pdf attached.