⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sx.m

📁 很多matlab的源代码
💻 M
字号:
function Y = sx(z2)
% SX Fresnel integral of the second kind
%
%    	Y = SX(Z) computes the Fresnel integral of the second kind for Z
%	This is accurate to about single precision.
%
%	SX (with no input arguments) invokes the following example:
%
%	%  Plot sx(x) vs x over (0 4) at intervals of 0.04
%    	   >>x = 0:0.04:4;
%    	   >>p = sx(x);
%    	   >>plot(x,p),grid


% ADSP Toolbox: Version 2.0 
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998


if nargin==0,help sx,disp('Strike a key to see results of the example')
pause,x=0:.04:4;p=sx(x);plot(x,p),axesn,grid,return,end

tol=2e-16;
z=abs(z2);
Y=0*z;s=prod(size(z));x=.5*pi*z.*z;y=x.*x;
i1=find(z<=pi);s1=prod(size(i1));
if s1>0
x1=x(i1);y1=y(i1);z1=z(i1);
Y(i1) = x1.*z1.*ghgf(1,2,[3/4 1 1 1],[1.5 1.75 1 1],-y1/4,tol)/3;
end
if s>s1
i2=(1:s);i2(i1)=[];x1=x(i2);y1=y(i2);z1=z(i2);
Y1 =ghgf(3,0,[1 3/4 5/4 1],[1 1 1 1],(-4)./y1,tol);
Y2 =ghgf(3,0,[1 1/4 3/4 1],[1 1 1 1],(-4)./y1,tol);
Y3=0.5-(0.5*sin(rem(x1,2*pi)).*Y1./x1 + cos(rem(x1,2*pi)).*Y2)./z1/pi;
Y(i2)=Y3;
end
Y=Y.*sign(z2);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -