for k=1:length(y)
f=@(x)y(k)*x-sin(x);
ezplot(f);%Draw a graph and observe that the zero point of the function is near x0(k)
z(k)=fzero(f,x0(k));% call the fzero function to find the zero point
endsxf2012 (Contact ta on the site)%% Take y as a data as an example, assuming that the y value is y0, then
%f=@(x)y0-sin(x)/x;%%Use command: %ezplot(f);
%%Draw a picture, observe the function, and find a coordinate x0 near the zero point
%% Then, the desired zero point is
%z=fzero(f,x0);% call the fzero function to find the zero point
%For example, y0=0.6, by using
f=@(x)0.6-sin(x)/x;%drawingezplot(f)hold onplot(,,'r')
%Observe that the zero point is near -2 and 2, use
z1=fzero(f,-2)
%The calculated zero point is x=-1.66
z2=fzero(f,2)
%The calculated zero point is x=1.66
This is the graph of y=sinx/x. In my case, the value of y is known, and I need to get all the values of x, that is, I want to get it through the inverse function. But the problem is that when y=1, x is one value, but y=0.8 is two values, and y=0.1 is many values.
This is the graph of y=sinx/x. In my case, the value of y is known, and I need to get all the values of x, that is, I want to get it through the inverse function. But... on the interval you drew, the function is not monotonic, so its inverse function does not exist, or it is a multi-valued function.
finv
F inverse cumulative distribution function
Syntax
X = finv(P,V1,V2)
Description
X = finv(P,V1,V2) computes the inverse of the F cdf with numerator degrees of freedom V1 and denominator degrees of freedom V2 for the corresponding probabilities in P. P, V1, and V2 can be vectors, matrices , or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs.
The parameters in V1 and V2 must all be positive integers, and the values in P must lie on the interval [0 1].
The F inverse function is defined in terms of the F cdf as
where
Examples
Find a value that should exceed 95% of the samples from an F distribution with 5 degrees of freedom in the numerator and 10 degrees of freedom in the denominator.
x = finv(0.95,5,10)
x =
3.3258
You would observe values greater than 3.3258 only 5% of the time by chance.
The above is the detailed content of Learn how to solve the inverse of the sinc function using MATLAB. For more information, please follow other related articles on the PHP Chinese website!