## 957 Reputation

14 years, 312 days
University of Kent
Dr

## A tiny latex (from Maple) superscripts p...

Maple 18

v1:=[seq(tau[lambda,i]^2,i=1..5)];

latex(v1);

gives:

[{\tau_{{\lambda,1}}}^{2},{\tau_{{\lambda,2}}}^{2},{\tau_{{\lambda,3}}
}^{2},{\tau_{{\lambda,4}}}^{2},{\tau_{{\lambda,5}}}^{2}]

which produces a non natural output in latex, see below.

I wonder it could be improved in the future release?

'latex' command is really useful when i have large algebric output. But having to change this tiny thing at many places is just very time consuming. I'd really appreciate if this can be fixed in updates or future versions of Maple.

Casper

## simplify and function with arguments...

Maple 18

Hi all,

I will use the following dummy example.

with function,f

f:=(xid,yid)->sum(x[i],i=1..xid)*sum(y[i],i=1..yid);

and a complicated term, myterm

myterm:=(f(3,4)+f(2,2))*f(1,1):
myterm:=expand(myterm);

'if' i have some previous knowledge, or know a bit of the term, i can find the structure by doing this

repar:=[f(1,1),f(2,2),f(3,4)];  # Or with more f(xid,yid) terms

tmp:=seq(repar[i]=ff[i],i=1..3);
simplify(myterm,{tmp});          # This is fine, gives me what i want

But, can we go further, and more 'obvious'

Given the fucntion f, same as before, and the same 'myterm'

can I have this
restart:
iwant:=(f(3,4)+f(2,2))*f(1,1);  # as a result, straightforward

so I dont have to go back to 'repar' and find that the terms exactly are.

Thanks,

## return the indicis of a value from list...

Maple 18

Hi, with a list

l:=[1,1,1,2,3,3,4];

What's the best way to get the index(s) for the values equal to '1'?

Say for x=1, we want

[1,2,3]

for x=2, we want

[4]

ect.

## How to take away each element in a Vecto...

Maple 18

Hi say I have the vector V1.

V1:=Vector([a,b,c,d,e,f,g]):

and function myfun.

how do i use it as the input to the function my fun, by taking away each element in turn?
myfun(V1[2..]);              # 1st element removed
myfun(V1[[1,3..]]);         # 2nd element removed
myfun(V1[[1,2,4..]]);      # 3rd element removed

and so go

is there a more efficient way?

Many thanks,

## pick up by the sum of the list elements...

Maple 18

Say I have this list,

tmp:=[[0, 1, 2], [1, 0, 2], [1, 1, 2], [1, 2, 0]];

and the sums of each element (list),

map(x->convert(x,+),tmp);

How do I quickly pickup the elements, where they sum to 3? Like this:

wanttohave:=[[0, 1, 2], [1, 0, 2],  [1, 2, 0]];

Thanks,

 First 7 8 9 10 11 12 13 Last Page 9 of 31
﻿