List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] max element of array
| [MUG] max element of array |
|
Author: Jeffrey Dambacher
Posted: Tue, 28 Jan 2003 15:54:09 +1100
|
>> From: "Jeffrey.Dambacher"
Dear Maple User Group,
I was wondering if there was any chance that a question I have regarding
Maple could be put to the Maple User Group. Please let me know what
resources are available to me in regards to the below question.
Thanks for any forthcoming help.
Best regards,
Jeffrey Dambacher
CSIRO Marine Research
Hobart, Tasmania
Australia
"Jeffrey.Dambacher"
-------------------------------------------------------------------
The problem is to find the maximum value of elements of a given array, of
length n, where elements of the array and length vary from one application
to another.
A fixed example given here, where
n:=5:
w:=array(1..n,[1,4,5,3,2]):
how do I pull out the max value of w without listing each w[j] element of w
as above? While I can do it for the above n=5 example with:
max(w[1],w[2],w[3],w[4],w[5]):
If I want to evaluate an array of length 4 or 6, I would have to either add
or subtract a w[j] element from the above command. I need to work off of
one command for any size of n. It seems that
max(w[1..n]);
or
max(entries(w));
should work, but they does not.
|
[View Complete Thread]
Previous by date: [MUG] plotting colors in maple, Kristian Jantz
Next by date: [MUG] multiple integration, Maple User Group
Previous thread: [MUG] Automata and Maple, Vesa-Matti Sarenius
Next thread: [MUG] multiple integration, Maple User Group
|