how to find the maximum of (2 sin(theta)^2 *cos(phi)^2) using matlab?

how to find the maximum value of (2 sin(theta)^2 *cos(phi)^2) using matlab? and also similar trigonometric functions in matlab

 Accepted Answer

As you have not restricted the range:
The minimum and maximum of the sin() and cos() functions are -1 and +1. In your expression they are both squared so the maximum values will be (-1)^2 and (+1)^2, which is +1 . Multiply two such independent maximum together gives +1 * +1 = +1 . Multiply that by 2 gives a maximum value of +2 .
The code to find the maximum is then
2 * 1 * 1
The difficulty of finding the maximum of other trig expressions depends greatly on what operators are allowed and what other functions are allowed.

2 Comments

its not the multiplication sign...n i understand it when u say 2*1*1...but achieving the same using functions in matlab to find the maximum of trigonometric function..i have spent the whole day trying to achieve this n i feel sick n tried
hey!!! it worked..separating each function...!thanx a lot!!

Sign in to comment.

More Answers (1)

Just use max()

2 Comments

well,i have tried..i have really been successful..could you show me how i could do it?? i always get an error??
That's because you need a multiplication sign between the "2" and the rest of the expression.

Sign in to comment.

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!