[Maxima] symbolic subscript of literal list or matrix
robert.dodier at gmail.com
Tue Jul 24 13:40:43 CDT 2007
On 7/21/07, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> On 7/21/07, Robert Dodier <robert.dodier at gmail.com> wrote:
> > At present Maxima complains if the subscript of a literal list or matrix
> > is not an integer. E.g. a : [1, 2, 3]; a[k] => error.
> > I would like to change it so that a subscript expression is returned.
> > E.g. a : [1, 2, 3]; a[k] => a[k]
> Why not [1,2,3][k]? I assume we are talking about evaluation here, not just
> simplification (in which case the value of a would be irrelevant).
[1, 2, 3][k] is OK by me, although it is a little clumsier.
> > b : matrix([1, 2], [x, y]); b[j, k] => b[j, k]
> Why not matrix([1,2],[x,y])[j,k]?
> Similarly, matrix([1,2],[3,4])[1,i] should be [1,2][i] and
> matrix([1,2],[3,4])[i,1] should be [1,3][i]. If you want to get fancy,
> matrix([1,2],[3,4])[i,i] could simplify to [1,4][i]....
Yes, these alternatives are OK too.
More information about the Maxima