Hello, please how can i find the xmax in integral for function ((2-x)/(1-x))^5/2. And holds that xmax = x.

5 views (last 30 days)
Hello, please how can i find the xmax in integral for function ((2-x)/(1-x))^5/2. And holds that xmax = x. I have data for
x=[0.871 0.928 0.946 0.952 0.958 0.965 0.971 0.971 0.979 0.987 0.992 0.995 0.997];
the right solution is 0.965. But i dont know, how to solve that porblem.
i create :
fun=@(x)((2-x)/(1-x))^(5/2);
q=integral(fun,0,x);
Thank you so much
  2 Comments
Jan
Jan on 2 Apr 2021
Edited: Jan on 2 Apr 2021
There is a missing parenthesis in:
fun = @(x) ((2 - x / (1 - x)) ^ 5 / 2;
% ^ according to the title
Where do you need the ) ? Is really ^5 / 2 is wanted, or ^(5/2)?
The question is not clear to me. You provide x as a vector, but integral would need the upper limit as a scalar.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 2 Apr 2021
Edited: Jan on 3 Apr 2021
x = [0.871 0.928 0.946 0.952 0.958 0.965 0.971 0.971 0.979 0.987 0.992 0.995 0.997];
fun = @(x)((2-x)/(1-x))^(5/2);
q = arrayfun(@(X)integral(fun,0,X),x);
[maxval, maxidx] = max(q);
x(maxidx), maxval

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!