Expression of y as a function of x for trigonometric equation

1 view (last 30 days)
Hello everyone,
How can I come up with a expression of y as a function of x for the following equation ?
arccos(1-2y)-2(1-2y)(y-y^2)^0.5-X = 0
Or If I have X values stored in a file, how can I find y value for those x? Thanks in advance. Tanjina
  1 Comment
Image Analyst
Image Analyst on 20 Oct 2015
MATLAB is case sensitive. Is your X the same as your x? What is the value of y and big X that you put in?

Sign in to comment.

Answers (1)

Torsten
Torsten on 21 Oct 2015
Edited: Torsten on 21 Oct 2015
f=@(y,x)acos(1-2*y)-2*(1-2*y)*(y-y^2)^0.5-x;
fun=@(y)f(y,x);
y0 = [0 1];
for k=1:numel(X)
x=X(k);
Y(k)=fzero(fun,y0);
end
where X is the array in which your x-values are stored.
Best wishes
Torsten.

Categories

Find more on Debugging and Analysis 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!