助matlab如何解sinc函數的反函數
for k=1:length(y)
f=@(x)y(k)*x-sin(x);
ezplot(f);%畫圖,觀察函數零點在x0(k)附近
z(k)=fzero(f,x0(k));%調用fzero函數找零點
endsxf2012(站內聯繫ta)%%以y爲一個數據爲例,假設y值爲y0,則令
%f=@(x)y0-sin(x)/x;%%用命令:%ezplot(f);
%%畫圖,觀察函數,隨便找零點附近的一個座標x0
%% 則,要的零點爲
%z=fzero(f,x0);%調用fzero函數找零點
%比如y0=0.6,通過令
f=@(x)0.6-sin(x)/x;%畫圖ezplot(f)hold onplot(,,'r')
%觀察知,零點在-2和2附近,用
z1=fzero(f,-2)
%計算得零點爲x=-1.66
z2=fzero(f,2)
%計算得零點爲x=1.66
這是y=sinx/x的曲線圖。我的情況是y的值是已知的,我需要把x的全部值出來,即想通過反函數來得。但是問題是,y=1時x是一個值,但y=0.8是兩個值,y=0.1就是許多值。
這是y=sinx/x的曲線圖。我的情況是y的值是已知的,我需要把x的全部值出來,即想通過反函數來得。但是 ... 在你畫的區間上,函數不是單調的,所以其反函數不存在的,或者說是個多值函數。
matlab中如何就反函數
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.
以上就是學習如何使用MATLAB求解sinc函數的逆函數的詳細內容,更多請關注本站其它相關文章!