I have a fairly simple problem that I imagine has a simple solution. I have a plot in which the x-axis represents a location (0-8) and the y-axis is the probability of a certain action occuring at that location. I need to identify the x value when there is a 50% chance of the action happening. Example data below.
x = [0,1,2,3,4,5,6,7,8];y = [0,0,0,.25,.25,.25,.75,1,1];plot(x,y);line([0,8],[.5,.5]);
I just need to identify the x value when y is 0.5. Is there a simple solution I am missing here? Thank you!
Best Answer