Loops to Find Maximum Value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Loops to Find Maximum Value
Find the maximum value from a list of data and also the value that results in the maximum data.
I have attached a mathcad prime 5 file and pic if you dont have Prime 5
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So here is one way to get what you are looking for:
File in Format Prime 5 attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Its not clear to me what values you look at to find the maximum.
Are you looking for the maximum of the 11 values which are calculated by
25*sin(j) * 15*sin(j) * ... * 20*sin(j)
as you write about the max value of the "product" (which?).
Or are you looking at the max of the 88 different values calculated by
25*sin(j)
15*sin(j)
...
In both cases it would suffice to look for the max of the eleven sin(j) values and you get the max always for j=1
You may use jmax:=lookup(max(sin(j)), sin(j), j)[0 to find out that jmax=1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi
I am after the max of 88 values.
The function may not be sine it could just be an list of numbers
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So here is one way to get what you are looking for:
File in Format Prime 5 attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here is a different approach using a used defined utility function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here's a compact implementation that also works in Prime Express:
Prime 4 file is attached.
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Elegant
