Hi all,
I've been trying, unsuccessfully, to extricate the numerical value of the fMax function, and I'm hoping someone can help me.
For instance, if I type fmax(sin(x),x,0,π) I get an output of:
{MaxValue=1,x=π/2}
Is there any way for me to assign just the numerical value of MaxValue to some letter?
Any suggestions are appreciated!
Fmax Output Help
Started by
ero
, Mar 14 2014 11:35 PM
2 replies to this topic
#1
Posted 14 March 2014 - 11:35 PM
#2
Posted 29 March 2014 - 09:05 AM
Hi.
fmax returns a list so you can use standard list functions on it. Assuming the list is stored in ans, you can retrieve its first element using ans[ 1 ] which wiil be MaxValue=1. Then use GetRight( ans[ 1 ] ) to get the right side of the equality which will give you 1. So in short you could do:
fmax(sin(x),x,0,π) A
GetRight( A[ 1 ] ) value
Now value contains 1.
fmax returns a list so you can use standard list functions on it. Assuming the list is stored in ans, you can retrieve its first element using ans[ 1 ] which wiil be MaxValue=1. Then use GetRight( ans[ 1 ] ) to get the right side of the equality which will give you 1. So in short you could do:
fmax(sin(x),x,0,π) A
GetRight( A[ 1 ] ) value
Now value contains 1.
- ero likes this
#3
Posted 12 May 2014 - 07:47 AM
MicroPro,
I had temporarily given up on the project that I needed this for, so had not been checking the thread, but a big (belated) thank you to you for helping me out with this.
I had temporarily given up on the project that I needed this for, so had not been checking the thread, but a big (belated) thank you to you for helping me out with this.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users