当前位置:文档之家› Optimal multihump filter for photometric redshifts

Optimal multihump filter for photometric redshifts

Optimal multihump filter for photometric redshifts
Optimal multihump filter for photometric redshifts

a r

X

i

v

:a

s t

r o

-

p

h

/

1

6

73

v

1

5

J u

n

2

1

Optimal multihump ?lter for photometric redshifts Tam′a s Budav′a ri 1,Alexander S.Szalay Department of Physics and Astronomy,The Johns Hopkins University,Baltimore,MD 21218budavari@https://www.doczj.com/doc/1815154064.html, Istv′a n Csabai 2Department of Physics,E¨o tv¨o s University,Budapest,Pf.32,Hungary,H-1518Andrew J.Connolly Department of Physics and Astronomy,University of Pittsburgh,Pittsburgh,PA 15260and Zlatan Tsvetanov Department of Physics and Astronomy,The Johns Hopkins University,Baltimore,MD 21218ABSTRACT We propose a novel type ?lter for multicolor imaging to improve on the photomet-ric redshift estimation of galaxies.An extra ?lter—speci?c to a certain photometric system—may be utilized with high e?ciency.We present a case study of the Hub-ble Space Telescope ’s Advanced Camera for Surveys and show that one extra exposure could cut down the mean square error on photometric redshifts by 34%over the z <1.3redshift range.

Subject headings:galaxies:distances and redshifts —galaxies:photometry —instru-mentation:miscellaneous

1.Introduction

The prediction of photometric redshifts (Koo 1985;Connolly et al.1995a;Gwyn &Hartwick 1996;Sawicki,Lin &Yee 1997;Hogg et al.1998;Wang,Bahcall &Turner 1998;Yee 1998;Fern′a ndez-Soto,Lanzetta,&Yahil 1999;Weymann et al.1999;Ben′?tez 2000;Csabai et al.2000;Budav′a ri

et al.2000)is built upon global continuum features of the underlying galaxy spectrum such as the Balmer break at4000?A.The more precisely one can localize these features,the more accurate the redshift estimates become.However,traditional broadband?lters were not designed to provide the best possible photometric redshifts,for several reasons.In theory,a set of?lters optimal for photometric redshift estimation might be designed,but this would probably be substantially di?erent from any current standard set.Here we do not intend to solve the generic problem of ?nding an optimal?lter set for photometric redshift estimation;this study shows how conventional ?lter sets can be extended to yield better photometric redshifts.

In Section1.1,we present the idea of an additional?lter and look into why and how an extra measurement—sampling the same wavelengths—can improve signi?cantly on photometric redshifts.In Section2,the algorithm is developed and we make a case study of the Advanced Camera for Surveys of the Hubble Space Telescope.Based on our analysis,we propose a novel type of“broad-band”?lter that can be e?ectively used for photometric redshifts.

1.1.The idea

The more general inversion problem of photometry in terms of redshift,type,and intrinsic luminosity(Koo1985;Connolly et al.1995a,b,1999;Budav′a ri et al.1999,2000;Csabai et al. 2000)involves the study of the Jacobian matrix of?uxes as a function of the physical parameters of galaxies.Our numerical simulations show that?lter sets yield more precise estimates when continuum spectral features are located around the overlap of two bands—both?uxes change rapidly with redshift.One way to improve the redshift estimates is to increase the number of ?lters and use narrower bands.This would require too many exposures and yield a non-standard photometric system(Hickson et al.1998).The other possibility is to put an intermediate width (IM)?lter in a broad band,which would help the redshift estimation by improving the resolution.

A single IM band can only help in a narrow redshift range,so additional,narrower?lters are needed for each broad band.This approach could triple the resolution but will heavily increase the total exposure time at the same signal-to-noise ratio.

We propose combining multiple IM?lters located in standard photometric bands into one “broadband”?lter.We call this a multihump?lter.The resulting new?lter will be able to improve the redshift prediction(wavelength resolution)over a much wider redshift range and will only require a single additional exposure of comparable length.

How does this really work?Our approach makes a large di?erence for blue galaxies.The4000?A break in their spectra shows up only as a small“bump”which makes the redshift estimation di?cult. Let us consider the worst-case scenario,a toy model spectrum of a late-type galaxy that declines with wavelength as a power law and has as its only spectral feature the approximately500?A wide bump.Without this feature,the colors would be the same at any redshift.The?ux changes with redshift within a band depending on the shape of the?lter.If its gradient is too small(e.g.?at

as a top-hat),tiny photometric errors can yield large errors in the redshift prediction.In other words,while the bump is in a broad band,it is hard to tell precisely where it is.The measured ?ux in our new?lter will change in redshift regions where the spectral feature is passing through one of the IM humps.These are the regions where the proposed?lter contributes the most to the redshift estimation and where the original?lter set has poor performance(small gradient).Red elliptical(E/S0)galaxies do not present a signi?cant problem,because the strong discontinuity at 4000?A changes noticeably the?uxes as it passes through the bands with redshift.In this case the additional?lter plays a subsidiary role,and the improvement of the accuracy is incremental.

2.Filter design

The actual throughput of a photometric system strongly depends on the instrument,di?erent projects use di?erent CCDs to gain more sensitivity in the desired wavelength range.The quantum e?ciency of these devices set strict constraints on the observable wavelength regime.The?lter set is selected to cover the available spectral interval according to science goals.The multihump?lter is speci?c to a?lter set,and its transmissivity is a?ected by the CCD’s quantum e?ciency(QE).

We have analyzed the photometric system of the Hubble Space Telescope’s Advanced Camera for Surveys(ACS Ford et al.1996)3.The two back-illuminated CCDs of the wide?eld channel are VIS-AR coated in order to optimize the response in the I band,and thus the U-band sensitivity has been sacri?ced.Mission speci?cations dictate the constraints on the multihump?lter that is to extend the original set of the g’,r’,i’and z’bands,which span the entire observable wavelength range.No bluer or redder?lter can be used,because the detector is not sensitive at shorter or longer wavelengths.

The framework of the algorithm is simple.We parameterize a?ctitious?lter curve and convolve it with the CCD’s actual QE to obtain a realistic response function.Simulated photometric catalogs of?uxes and errors are generated using the extended?lter set.The goodness of a particular?lter set is assessed by computing the errors on the redshift estimates.

In the context of current?lter manufacturing techniques(O?er&Bland-Hawthorn1998),a feasible parameterization of the additional?lter’s response function(R(λ),see Figure1)consists of at most two notch?lters,plus a low and a high cuto?,as described by

R(λ)=1

π

arctan ?·(λ?λend)

?exp ? λ?λ1?λ2 p .(1)

Parametersλstart andλend are the limits of the?lter,and?determines the gradients,the rise of the edges.The values ofλ1andλ2correspond to the locations of the notches and p(an even number)

changes their shape.

The mock catalogs were generated based on spectral energy distributions(SEDs)derived from a physical interpolation scheme applied to the spectra of Coleman,Wu&Weedman(1980),as described in Connolly et al.(1999)and Budav′a ri et al.(2000).On a high resolution redshift grid (δz=5×10?3),a hundred objects were generated at each grid point with random SEDs.The continuous type parameter was scaled to yield a population of galaxies in which the probability of having a spectral type between Ell and Sbc was10%,Sbc–Scd35%,Scd–Irr35%,and bluer 20%.The?uxes were modulated with3%photometric errors taken from a Gaussian distribution. The quality of the photometric redshifts is determined by computing the rms of the estimates. The error is calculated for the desired redshift interval(or regions)meeting the actual project requirements—in this study,redshifts between z=0.2and z=1.2.

The actual optimization problem has quite a few parameters(see Equation1)to solve for, which makes it hard to numerically?nd the global minimum.It is also quite time-consuming to evaluate the underlying function;a new loop of the simulation has to be completed each time.Also extra constraints were added to the problem.To be able to use the very same?lter from the ground for testing purposes or in follow-up observations,a design compromise due to the atmosphere has been made.In the actual optimization algorithm,one of the notches was always forced to include the5577?A sky line.To map the entire parameter space,a linear search on a coarse grid was used to?nd the best possible?lter candidates,and then from the those minima,a gradient method was utilized with discrete,higher resolution step-sizes.

3.Discussion

The resulting shape of the multihump is shown in Figure2.This best con?guration has two humps and its transmissivity peaks at the shortest possible wavelengths in the g’band and,at longer wavelength,in the i’band.Since the ACS?lters look almost like triangles(as a result of the strong wavelength dependency in the CCD’s QE),our additional?lter tries to intensify the changes in colors,at the lowest,z~0.2,and highest,z~1.2,redshifts.On one side,the optimal multihump?lter is essentially trying to compensate the lack of a ultraviolet?lter by boosting the contrast at the edge of the g’band.In fact,the algorithm also?nds an optimal solution of having a U band,which is not a real option because of the CCD’s QE(see Section2).The location of the hump in the i’is clearly set by the upper redshift limit z 1.2,when the Balmer break is at 8800?A.

Figure3compares the performance of the original and extended?lter sets by plotting the rms error as a function of redshift.The accuracy of photometric redshifts for the entire catalog is shown ?rst.The prediction improves at all redshifts;the overall improvement is

σ2orig?σ2ext

Q=

Early-and late-type subsamples are shown in the middle and right panels of Figure3,respectively. The E/S0estimates clearly get better at the smallest redshifts,z 0,and at around z 1.2,when the4000?A break is in one of the humps.However,the redshift prediction also improves in another redshift region,around z~0.55,as a result of the Hβand Mg i absorption as it passes through the second hump.In according with our expectations,redshift estimates of the late-type galaxies change much more drastically then those estimated for early types.

The large number of parameters makes it di?cult to estimate the errors or covariances.In Table1,the rms errors computed for di?erent set of?lters are shown.The original ACS?lter set givesσz=0.075.If we try additional multihump?lters with humps centered on the g’r’i’and g’r’z’bands,the performance just slightly improves;σz=0.072and0.073,respectively.Centering humps on the gaps between the original bands(o?-band multihump?lter)does not improve on the accuracy of the estimates either;σz=0.073.The optimized?lter yields much better redshifts,σz=0.058.The gain in the entire catalog is comparable to what would be achievable by using separate IM?lters.The redshift accuracy can be marginally increased by splitting the optimal multihump into two separate?lters(σz=0.055),but the additional exposure time would be more than twice as long as in our approach.

4.Conclusion

We propose the use of multihump?lters extending standard photometric systems to make photometric redshift estimation much more e?cient.Our simulations have shown that an optimized extra?lter could improve the redshift prediction by34%for the Advanced Camera for Surveys. The improvement takes place over the z<1.3redshift range.The?lter’s e?ective width is about 1500?A,comparable to the existing photometric bands,so the measurement would require only about25%more exposure time.Such a?lter can be built with today’s technology;in fact,similar ?lters have been utilized to suppres atmospheric features at near-infrared wavelengths(O?er& Bland-Hawthorn1998).The shape of the extra?lter can be tuned to di?erent goals and missions. It can be optimized for di?erent?lter sets and adjusted to desired redshift ranges.

I.C.and T.B.acknowledge partial support from the Hungarian Academy of Sciences–NSF grant124and the Hungarian National Scienti?c Research Foundation grant T030836,A.J.C.ac-knowledges support from NASA through a Long Term Space Astrophysics grant(NAG5-7934)and through grant GO-07817.06-96A from the Space Telescope Science Institute. A.S.acknowledges support from the NSF(AST98-02980)and the NASA Long Term Space Astrophysics program (NAG5-3503).

REFERENCES

Ben′?tez,N.,2000,ApJ,536,571

Budav′a ri,T.,Szalay,A.S.,Connolly,A.J.,Csabai,I.&Dickinson,M.E.,1999,in Photometric Red-shifts and High Redshift Galaxies,eds.R.J.Weymann,L.J.Storrie–Lombardi,M.Sawicki, &R.Brunner,(San Francisco:ASP),19

Budav′a ri,T.,Szalay,A.S.,Connolly,A.J.,Csabai,I.&Dickinson,M.E.,2000,AJ,120,1588

Coleman,G.D.,Wu.,C.-C.,&Weedman,D.W.,1980,ApJS,43,393

Connolly,A.J.,Csabai,I.,Szalay,A.S.,Koo,D.C.,Kron,R.G.,&Munn,J.A.,1995a,AJ,110, 2655

Connolly,A.J.,Szalay,A.S.,Bershady,M.A.,Kinney,A.L.,&Calzetti,D.,1995b,AJ,110,1071

Connolly,A.J.,Budav′a ri,T.,Szalay,A.S.,Csabai,I.,&Brunner,R.J.,1999,in Photometric Red-shifts and High Redshift Galaxies,eds.R.J.Weymann,L.J.Storrie–Lombardi,M.Sawicki, &R.Brunner,(San Francisco:ASP),13

Csabai,I.,Connolly,A.J.,Szalay,A.S.,&Budav′a ri,T.,2000,AJ,119,69

Fern′a ndez-Soto,A.,Lanzetta,K.M.,&Yahil,A.,1999,ApJ,513,34

Ford,H.C.,et al.,1996,SPIE,2807,184

Gwyn,S.D.J.,&Hartwick,F.D.A.,1996,ApJ,468,L77

Hickson,P.,et al.,1998,SPIE,3352,226

Hogg,D.W,et al.,1998,AJ,115,1418

Koo,D.C.,1985,AJ,90,148

O?er,A.R.,&Bland-Hawthorn,J.,1998,MNRAS,229,176

Sawicki,M.J.,Lin,H.,&Yee,H.K.C,1997,AJ,113,1

Wang,Y.,Bahcall,N.,&Turner,E.L.,1998,AJ,116,2081

Weymann,R.J.,Storrie–Lombardi,L.J.,Sawicki,M.,&Brunner,R.,(editors),1999,Photometric Redshifts and High–Redshift Galaxies(San Francisco:ASP)

Yee,H.K.C.,1998,in Proc.10th Recontres de Blois,in press(astro-ph/9809347)

Table1.Errors on Photometric Redshifts

Filter Set?z rmsλstartλendλ1?λ1λ2?λ2p?

Fig.1.—Illustration of the?lter’s response curve,as de?ned by Equation1.

Fig.2.—The throughput of the?lters as used in convolutions.The original g’,r’,i’,and z’bands are represented by solid lines(left to right).The add-on multihump?lter(dotted line)is scaled

down by30%for illustration.

Fig. 3.—The rms error on photometric redshifts using the original?lter set(solid line)and the extended set(dotted line).Left to right:The improvement for the entire population in the simulation and for the red(E/S0)and blue subsamples,respectively.The large errors at low

redshifts are due to the lack of the U band;at redshift z>1,one would need a J band or higher.

(完整版)MATLAB常用函数大全

一、MATLAB常用的基本数学函数 abs(x):纯量的绝对值或向量的长度 angle(z):复数z的相角(Phase angle) sqrt(x):开平方 real(z):复数z的实部 imag(z):复数z的虚部 conj(z):复数z的共轭复数 round(x):四舍五入至最近整数 fix(x):无论正负,舍去小数至最近整数 floor(x):地板函数,即舍去正小数至最近整数ceil(x):天花板函数,即加入正小数至最近整数rat(x):将实数x化为分数表示 rats(x):将实数x化为多项分数展开 sign(x):符号函数(Signum function)。 当x<0时,sign(x)=-1; 当x=0时,sign(x)=0; 当x>0时,sign(x)=1。 rem(x,y):求x除以y的馀数 gcd(x,y):整数x和y的最大公因数 lcm(x,y):整数x和y的最小公倍数 exp(x):自然指数 pow2(x):2的指数 log(x):以e为底的对数,即自然对数或 log2(x):以2为底的对数 log10(x):以10为底的对数 二、MATLAB常用的三角函数 sin(x):正弦函数 cos(x):余弦函数

tan(x):正切函数 asin(x):反正弦函数 acos(x):反馀弦函数 atan(x):反正切函数 atan2(x,y):四象限的反正切函数 sinh(x):超越正弦函数 cosh(x):超越馀弦函数 tanh(x):超越正切函数 asinh(x):反超越正弦函数 acosh(x):反超越馀弦函数 atanh(x):反超越正切函数 三、适用於向量的常用函数有: min(x): 向量x的元素的最小值 max(x): 向量x的元素的最大值 mean(x): 向量x的元素的平均值 median(x): 向量x的元素的中位数 std(x): 向量x的元素的标准差 diff(x): 向量x的相邻元素的差 sort(x): 对向量x的元素进行排序(Sorting)length(x): 向量x的元素个数 norm(x): 向量x的欧氏(Euclidean)长度sum(x): 向量x的元素总和 prod(x): 向量x的元素总乘积 cumsum(x): 向量x的累计元素总和cumprod(x): 向量x的累计元素总乘积 dot(x, y): 向量x和y的内积 cross(x, y): 向量x和y的外积 四、MATLAB的永久常数

matlab中常见函数功用

⊙在matlab中clear,clc,clf,hold作用介绍 clear是清变量, clc只清屏, clf清除图形窗口上的旧图形, hold on是为了显示多幅图像时,防止新的窗口替代旧的窗口。 ①format:设置输出格式 对浮点性变量,缺省为format short. format并不影响matlab如何计算和存储变量的值。对浮点型变量的计算,即单精度或双精度,按合适的浮点精度进行,而不论变量是如何显示的。对整型变量采用整型数据。整型变量总是根据不同的类(class)以合适的数据位显示,例如,3位数字显示显示int8范围-128:127。 format short, long不影响整型变量的显示。 format long 显示15位双精度,7为单精度(scaled fixed point) format short 显示5位(scaled fixed point format with 5 digits) format short eng 至少5位加3位指数 format long eng 16位加至少3位指数 format hex 十六进制 format bank 2个十进制位 format + 正、负或零 format rat 有理数近似 format short 缺省显示 format long g 对双精度,显示15位定点或浮点格式,对单精度,显示7位定点或浮点格式。 format short g 5位定点或浮点格式 format short e 5位浮点格式 format long e 双精度为15位浮点格式,单精度为7为浮点格式 ②plot函数 基本形式 >> y=[0 0.58 0.70 0.95 0.83 0.25]; >> plot(y) 生成的图形是以序号为横坐标、数组y的数值为纵坐标画出的折线。 >> x=linspace(0,2*pi,30); % 生成一组线性等距的数值 >> y=sin(x); >> plot(x,y) 生成的图形是上30个点连成的光滑的正弦曲线。 多重线 在同一个画面上可以画许多条曲线,只需多给出几个数组,例如 >> x=0:pi/15:2*pi; >> y=sin(x); >> w=cos(x);

matlab 常用函数汇总

matlab 常用函数汇总 编程2008-07-10 21:45:20 阅读46 评论0 字号:大中小订阅matlab常用函数 图形注释 Title 图形标题 Xlabel X轴标记 Ylabel Y轴标记 Text 文本注释 Gtext 用鼠标放置文本 Grid 网格线 MATLAB编程语言 Function 增加新的函数 Eval 执行由MA TLAB表达式构成的字串 Feval 执行由字串指定的函数 Global 定义全局变量 程序控制流 If 条件执行语句 Else 与if命令配合使用 Elseif 与if命令配合使用 End For,while和if语句的结束 For 重复执行指定次数(循环) While 重复执行不定次数(循环) Break 终止循环的执行 Return 返回引用的函数 Error 显示信息并终止函数的执行 交互输入 Input 提示用户输入 Keyboard 像底稿文件一样使用键盘输入 Menu 产生由用户输入选择的菜单 Pause 等待用户响应 Uimenu 建立用户界面菜单 Uicontrol 建立用户界面控制 一般字符串函数 Strings MATLAB中有关字符串函数的说明 Abs 变字符串为数值 Setstr 变数值为字符串 Isstr 当变量为字符串时其值为真 Blanks 空串 Deblank 删除尾部的空串 Str2mat 从各个字符串中形成文本矩阵 Eval 执行由MA TLAB表达式组成的串 字符串比较 Strcmp , , , 比较字符串 Findstr 在一字符串中查找另一个子串

Upper 变字符串为大写 Lower 变字符串为小写 Isletter 当变量为字母时,其值为真 Isspace 当变量为空白字符时,其值为真 字符串与数值之间变换 Num2str 变数值为字符串 Int2str 变整数为字符串 Str2num 变字符串为数值 Sprintf 变数值为格式控制下的字符串 Sscanf 变字符串为格式控制下的数值 十进制与十六进制数之间变换 Hex2num 变十六进制为IEEE标准下的浮点数Hex2dec 变十六制数为十进制数 Dec2hex 变十进制数为十六进制数 建模 Append 追加系统动态特性 Augstate 变量状态作为输出 Blkbuild 从方框图中构造状态空间系统Cloop 系统的闭环 Connect 方框图建模 Conv 两个多项式的卷积 Destim 从增益矩阵中形成离散状态估计器Dreg 从增益矩阵中形成离散控制器和估计器Drmodel 产生随机离散模型 Estim 从增益矩阵中形成连续状态估计器Feedback 反馈系统连接 Ord2 产生二阶系统的A、B、C、D Pade 时延的Pade近似 Parallel 并行系统连接 Reg 从增益矩阵中形成连续控制器和估计器Rmodel 产生随机连续模型 Series 串行系统连接 Ssdelete 从模型中删除输入、输出或状态ssselect 从大系统中选择子系统 模型变换 C2d 变连续系统为离散系统 C2dm 利用指定方法变连续为离散系统 C2dt 带一延时变连续为离散系统 D2c 变离散为连续系统 D2cm 利用指定方法变离散为连续系统 Poly 变根值表示为多项式表示 Residue 部分分式展开 Ss2tf 变状态空间表示为传递函数表示 Ss2zp 变状态空间表示为零极点表示

(完整版)matlab函数大全最完整版

MATLAB函数大全 Matlab有没有求矩阵行数/列数/维数的函数? ndims(A)返回A的维数 size(A)返回A各个维的最大元素个数 length(A)返回max(size(A)) [m,n]=size(A)如果A是二维数组,返回行数和列数nnz(A)返回A中非0元素的个数 MATLAB的取整函数:fix(x), floor(x) :,ceil(x) , round(x) (1)fix(x) : 截尾取整. >> fix( [3.12 -3.12]) ans = 3 -3 (2)floor(x):不超过x 的最大整数.(高斯取整) >> floor( [3.12 -3.12]) ans =

3 -4 (3)ceil(x) : 大于x 的最小整数>> ceil( [3.12 -3.12]) ans = 4 -3 (4)四舍五入取整 >> round(3.12 -3.12) ans = >> round([3.12 -3.12]) ans =

3 -3 >> 如何用matlab生成随机数函数 rand(1) rand(n):生成0到1之间的n阶随机数方阵rand(m,n):生成0到1之间的m×n的随机数矩阵(现成的函数) 另外: Matlab随机数生成函数 betarnd 贝塔分布的随机数生成器 binornd 二项分布的随机数生成器 chi2rnd 卡方分布的随机数生成器 exprnd 指数分布的随机数生成器 frnd f分布的随机数生成器 gamrnd 伽玛分布的随机数生成器 geornd 几何分布的随机数生成器 hygernd 超几何分布的随机数生成器

matlab__function非常全的_matlab_函数

一、常用对象操作:除了一般windows窗口的常用功能键外。 1、!dir 可以查看当前工作目录的文件。!dir& 可以在dos状态下查看。 2、who 可以查看当前工作空间变量名,whos 可以查看变量名细节。 3、功能键: 功能键快捷键说明 方向上键Ctrl+P 返回前一行输入 方向下键Ctrl+N 返回下一行输入 方向左键Ctrl+B 光标向后移一个字符 方向右键Ctrl+F 光标向前移一个字符 Ctrl+方向右键Ctrl+R 光标向右移一个字符 Ctrl+方向左键Ctrl+L 光标向左移一个字符 home Ctrl+A 光标移到行首 End Ctrl+E 光标移到行尾 Esc Ctrl+U 清除一行 Del Ctrl+D 清除光标所在的字符 Backspace Ctrl+H 删除光标前一个字符 Ctrl+K 删除到行尾 Ctrl+C 中断正在执行的命令 4、clc可以命令窗口显示的内容,但并不清除工作空间。 二、函数及运算 1、运算符: +:加,-:减,*:乘,/:除,\:左除^:幂,‘:复数的共轭转置,():制定运算顺序。 2、常用函数表: sin( ) 正弦(变量为弧度) Cot( ) 余切(变量为弧度) sind( ) 正弦(变量为度数) Cotd( ) 余切(变量为度数) asin( ) 反正弦(返回弧度) acot( ) 反余切(返回弧度) Asind( ) 反正弦(返回度数) acotd( ) 反余切(返回度数) cos( ) 余弦(变量为弧度) exp( ) 指数 cosd( ) 余弦(变量为度数) log( ) 对数 acos( ) 余正弦(返回弧度) log10( ) 以10为底对数 acosd( ) 余正弦(返回度数) sqrt( ) 开方 tan( ) 正切(变量为弧度) realsqrt( ) 返回非负根 tand( ) 正切(变量为度数)

MATLAB中常用的函数

[转]MATLAB 主要函数(一) (2008-05-11 17:09:43) 转载 标签: 分类:IT matlab 函数 杂谈 MATLAB主要函数指令表(按功能分类)原贴地址:https://www.doczj.com/doc/1815154064.html,/casularm/archive/2007/04/20/1572638.aspx 1常用指令(General Purpose Commands) 1.1通用信息查询(General information) demo 演示程序 help 在线帮助指令 helpbrowser 超文本文档帮助信息 helpdesk 超文本文档帮助信息 helpwin 打开在线帮助窗 info MATLAB 和MathWorks 公司的信息 subscribe MATLAB 用户注册 ver MATLAB 和TOOLBOX 的版本信息 version MATLAB 版本 whatsnew 显示版本新特征 1.2工作空间管理(Managing the workspace) clear 从内存中清除变量和函数 exit 关闭MATLAB load 从磁盘中调入数据变量 pack 合并工作内存中的碎块 quit 退出MATLAB save 把内存变量存入磁盘 who 列出工作内存中的变量名

whos 列出工作内存中的变量细节 workspace 工作内存浏览器 1.3管理指令和函数(Managing commands and functions) edit 矩阵编辑器 edit 打开M 文件 inmem 查看内存中的P 码文件 mex 创建MEX 文件 open 打开文件 pcode 生成P 码文件 type 显示文件内容 what 列出当前目录上的M、MAT、MEX 文件 which 确定指定函数和文件的位置 1.4搜索路径的管理(Managing the seach patli) addpath 添加搜索路径 rmpath 从搜索路径中删除目录 path 控制MATLAB 的搜索路径 pathtool 修改搜索路径 1.5指令窗控制(Controlling the command window) beep 产生beep 声 echo 显示命令文件指令的切换开关 diary 储存MATLAB 指令窗操作内容 format 设置数据输出格式 more 命令窗口分页输出的控制开关 1.6操作系统指令(Operating system commands) cd 改变当前工作目录 computer 计算机类型 copyfile 文件拷贝 delete 删除文件 dir 列出的文件 dos 执行dos 指令并返还结果

MATLAB一些函数实例

1.三角波产生器 t=-3:0.01:3; f1=tripuls(t); subplot(3,1,1); plot(t,f1); axis([-3,3,-0.2,1.2]) set(gcf,'color','w'); f2=tripuls(t,4); subplot(3,1,2); plot(t,f2); axis([-3,3,-0.2,1.2]) %set(gcf,'color','w'); f3=tripuls(t,4,-1); subplot(3,1,3); plot(t,f3); axis([-3,3,-0.2,1.2]) 2.离散序列的相加与相乘 function[x,n]=jxl(x1,x2,n1,n2) n=min(min(n1),min(n2)):max(max(n1),max(n2)); s1=zeros(1,length(n));s2=s1; s1(find((n>=min(n1))&(n<=max(n1))==1))=x1; s2(find((n>=min(n2))&(n<=max(n2))==1))=x2; x=s1+s2;//x=s1.*s2:%序列乘 axis([(min(min(n1),min(n2))-1),(max(max(n1),max(n2))+1),(min(x)-0.5), (max(x)+0.5)]) 3.序列的反摺 function[x,n]=xlfz(x1,n1) x=fliplr(x1);n=fliplr(n1); stem(n,x,'filled') axis([min(n)-1,max(n)+1,min(x)-0.5,max(x)+0.5]) 4.序列的卷积 function[x,n]=gghconv(x1,x2,n1,n2) x=conv(x1,x2) ns=n1(1)+n2(1); leg=length(x1)+length(x2)-2; n=ns:(ns+leg) subplot(2,2,1) stem(n1,x1,'filled') title('x1(n)') xlabel('n') subplot(2,2,2)

Matlab中常用的函数集

sort (排序) xlsread ( exl文件导入) load (txt 文件,mat文件等导入) 附录Ⅰ工具箱函数汇总 Ⅰ.1 统计工具箱函数 表Ⅰ-1 概率密度函数 函数名对应分布的概率密度函数 betapdf 贝塔分布的概率密度函数 binopdf 二项分布的概率密度函数 chi2pdf 卡方分布的概率密度函数 exppdf 指数分布的概率密度函数 fpdf f分布的概率密度函数 gampdf 伽玛分布的概率密度函数 geopdf 几何分布的概率密度函数 hygepdf 超几何分布的概率密度函数normpdf 正态(高斯)分布的概率密度函数lognpdf 对数正态分布的概率密度函数nbinpdf 负二项分布的概率密度函数 ncfpdf 非中心f分布的概率密度函数nctpdf 非中心t分布的概率密度函数 ncx2pdf 非中心卡方分布的概率密度函数poisspdf 泊松分布的概率密度函数 raylpdf 雷利分布的概率密度函数 tpdf 学生氏t分布的概率密度函数unidpdf 离散均匀分布的概率密度函数unifpdf 连续均匀分布的概率密度函数weibpdf 威布尔分布的概率密度函数 表Ⅰ-2 累加分布函数 函数名对应分布的累加函数 betacdf 贝塔分布的累加函数 binocdf 二项分布的累加函数 chi2cdf 卡方分布的累加函数 expcdf 指数分布的累加函数 fcdf f分布的累加函数 gamcdf 伽玛分布的累加函数 geocdf 几何分布的累加函数 hygecdf 超几何分布的累加函数

logncdf 对数正态分布的累加函数 nbincdf 负二项分布的累加函数 ncfcdf 非中心f分布的累加函数 nctcdf 非中心t分布的累加函数 ncx2cdf 非中心卡方分布的累加函数 normcdf 正态(高斯)分布的累加函数 poisscdf 泊松分布的累加函数 raylcdf 雷利分布的累加函数 tcdf 学生氏t分布的累加函数 unidcdf 离散均匀分布的累加函数 unifcdf 连续均匀分布的累加函数 weibcdf 威布尔分布的累加函数 表Ⅰ-3 累加分布函数的逆函数 函数名对应分布的累加分布函数逆函数 betainv 贝塔分布的累加分布函数逆函数 binoinv 二项分布的累加分布函数逆函数 chi2inv 卡方分布的累加分布函数逆函数 expinv 指数分布的累加分布函数逆函数 finv f分布的累加分布函数逆函数 gaminv 伽玛分布的累加分布函数逆函数 geoinv 几何分布的累加分布函数逆函数hygeinv 超几何分布的累加分布函数逆函数logninv 对数正态分布的累加分布函数逆函数nbininv 负二项分布的累加分布函数逆函数ncfinv 非中心f分布的累加分布函数逆函数nctinv 非中心t分布的累加分布函数逆函数 ncx2inv 非中心卡方分布的累加分布函数逆函数icdf norminv 正态(高斯)分布的累加分布函数逆函数poissinv 泊松分布的累加分布函数逆函数 raylinv 雷利分布的累加分布函数逆函数 tinv 学生氏t分布的累加分布函数逆函数unidinv 离散均匀分布的累加分布函数逆函数unifinv 连续均匀分布的累加分布函数逆函数weibinv 威布尔分布的累加分布函数逆函数 表Ⅰ-4 随机数生成器函数

MATLAB常用函数

数字信号处理与MATLAB 实现 1. n1=[ns:nf]; x1=[zeros(1,n0-ns),1,zeros (1,nf-n0)]; %单位抽样序列的产生 2. subplot(2,2,4) 画2行2列的第4个图 3. stem(n,x) %输出离散序列,(plot 连续) 4. 编写子程序可调用 4.1 单位抽样序列)(0n n -δ生成函数impseq.m [x,m]=impseq(n0,ns,nf); %序列的起点为ns ,终点为nf ,在n=n0点处生成一个单位脉冲 n=[-5:5];x1=3*impseq(2,-5,5)-impseq(-4,-5,5) x1 = 0 -1 0 0 0 0 0 3 0 0 0 n=[-5:5];x1=3*impseq(2,-4,5)-impseq(-4,-5,4) %起点到终点长度要一致 x1 = 0 -1 0 0 0 0 3 0 0 0 4.2 单位阶跃序列)(0n n u -生成函数stepseq.m [x,n]=stepseq(no,ns,nf) %序列的起点为ns ,终点为nf ,在n=n0点处生成一个单位阶跃 4.3 两个信号相加的生成函数sigadd.m [y,n]=sigadd(x1,n1,x2,n2) 4.4 两个信号相乘的生成函数sigmult.m [y,n]=sigmult(x1,n1,x2,n2) 4.5 序列移位y(n)=x(n-n0)的生成函数sigshift.m [y,n]=sigshift(x,m,n0) 4.6 序列翻褶y(n)=x(-n)的生成函数sigfold.m [y,n]=sigfold(x,n) 4.7 evenodd.m 函数可以将任一给定的序列x(n)分解为xe(n)和xo(n)两部分 [xe,xo,m]=evenodd(x,n) 4.8 序列从负值开始的卷积conv_m, conv 默认从0开始 function [y,ny]=conv_m(x,nx,h,nh) 有{x(n):nx1≤n ≤nx2},{h(n):nh1≤n ≤nh2}, 卷积结果序列为 {y(n):nx1+nh1≤n ≤nx2+nh2} 例. 设1132)(-++=z z z X ,1225342)(-+++=z z z z X ,求)()()(21z X z X z Y += 程序: x1=[1,2,3];n1=-1:1; x2=[2,4,3,5];n2=-2:1; [y,n]=conv_m(x1,n1,x2,n2)

MatLab常用函数大全

1、求组合数 C,则输入: 求k n nchoosek(n,k) 例:nchoosek(4,2) = 6. 2、求阶乘 求n!.则输入: Factorial(n). 例:factorial(5) = 120. 3、求全排列 perms(x). 例:求x = [1,2,3]; Perms(x),输出结果为: ans = 3 2 1 3 1 2 2 3 1 2 1 3 1 2 3 1 3 2 4、求指数 求a^b:Power(a,b) ; 例:求2^3 ; Ans = pow(2,3) ; 5、求行列式 求矩阵A的行列式:det(A); 例:A=[1 2;3 4] ; 则det(A) = -2 ; 6、求矩阵的转置 求矩阵A的转置矩阵:A’ 转置符号为单引号. 7、求向量的指数 求向量p=[1 2 3 4]'的三次方:p.^3 例: p=[1 2 3 4]' A=[p,p.^2,p.^3,p.^4] 结果为:

注意:在p 与符号”^”之间的”.”不可少. 8、求自然对数 求ln(x):Log(x) 例:log(2) = 0.6931 9、求矩阵的逆矩阵 求矩阵A 的逆矩阵:inv(A) 例:a= [1 2;3 4]; 则 10、多项式的乘法运算 函数conv(p1,p2)用于求多项式p1和p2的乘积。这里,p1、p2是两个多项式系数向量。 例2-2 求多项式43810x x +-和223x x -+的乘积。 命令如下: p1=[1,8,0,0,-10]; p2=[2,-1,3]; c=conv(p1,p2) 11、多项式除法 函数[q ,r]=deconv(p1,p2)用于多项式p1和p2作除法运算,其中q 返回多项式p1除以p2的商式,r 返回p1除以p2的余式。这里,q 和r 仍是多项式系数向量。 例2-3 求多项式43810x x +-除以多项式223x x -+的结果。 命令如下: p1=[1,8,0,0,-10]; p2=[2,-1,3]; [q,r]=deconv(p1,p2) 12、求一个向量的最大值 求一个向量x 的最大值的函数有两种调用格式,分别是:

matlab中常用的函数

A abs 绝对值、模、字符的ASCII码值 acos 反余弦 acosh 反双曲余弦 acot 反余切 acoth 反双曲余切 acsc 反余割 acsch 反双曲余割 align 启动图形对象几何位置排列工具 all 所有元素非零为真 angle 相角 ans 表达式计算结果的缺省变量名any 所有元素非全零为真area 面域图 argnames 函数M文件宗量名asec 反正割 asech 反双曲正割 asin 反正弦 asinh 反双曲正弦 assignin 向变量赋值 atan 反正切 atan2 四象限反正切 atanh 反双曲正切 autumn 红黄调秋色图阵axes 创建轴对象的低层指令axis 控制轴刻度和风格的高层指令 B bar 二维直方图 bar3 三维直方图 bar3h 三维水平直方图barh 二维水平直方图 base2dec X进制转换为十进制bin2dec 二进制转换为十进制blanks 创建空格串 bone 蓝色调黑白色图阵box 框状坐标轴 break while 或for 环中断指令brighten 亮度控制 C capture ;3版以前?捕获当前图形cart2pol 直角坐标变为极或柱坐标cart2sph 直角坐标变为球坐标cat 串接成高维数组 caxis 色标尺刻度 cd 指定当前目录 cdedit 启动用户菜单、控件回调函数设计工具 cdf2rdf 复数特征值对角阵转为实数块对角阵 ceil 向正无穷取整 cell 创建元胞数组 cell2struct 元胞数组转换为构架数组celldisp 显示元胞数组内容cellplot 元胞数组内部结构图示char 把数值、符号、内联类转换为字符对象 chi2cdf 分布累计概率函数 chi2inv 分布逆累计概率函数chi2pdf 分布概率密度函数 chi2rnd 分布随机数发生器 chol Cholesky分解

MATLAB常用函数

1概述安装介绍(略)。 2 矩阵和数组 2.1 创建特殊矩阵函数 Compan 伴随矩阵Diag 对角矩阵Eye 单位矩阵Gallery 测试矩阵Hadamard hadamard矩阵Hilb hilb矩阵Invhilb invhilb矩阵 Magic魔方矩阵Ones 全一矩阵Rand均匀分布随机矩阵 Randn 正态分布随机矩阵Rosser经典对称特征测试矩阵 Wilkinson wilkinson特征值测试矩阵Zeros 全零矩阵 注:diag(A,n)以向量A为主对角线为基准偏移n个位置。 2.2 矩阵连接 水平c=[a,b]或者c=[a b] 垂直c=[a;b] 连接函数(1)Cat 指定方向;(2)Cat(1,a,b)水平;(3)Cat(2,a,b)垂直;(4)Horzcat 水平方向;(5)Vertcat 垂直方向(6)Repmat 对现有矩阵复制粘贴(7)Blkdiag 以对角阵方式重组。 2.3 改变矩阵形状 Reshape 制定行列重排;Rot90 逆时针90;Filplr 垂直方向为轴旋转180;Flipud 水平方向为轴旋转180;Flipdim 指定方向为轴翻转矩阵 2.4 向量生成函数 Linspace(a,b)首尾为a,b的100个数;Linspace(a,b,n) Logspace(a,b)以10为底;Logspace(a,b,n);Logspace(a,pi) 2.5 矩阵信息的获取 Isempty 判断为空;Isscalar 判断为标量;Isvector 判断向量;Issparse 判断稀疏矩阵;Isa 判断指定数据类型;Iscell 判断元胞数组类型;Iscellstr 元胞字符串数组类型;Isfloat 判断浮点数;Isinteger 判断整形类型;Islogical 判断逻辑类型Isnumeric 判断数值类型;Isreal 判断实数类型;Isstruct 判断结构体类型;Length 最长维长度;Ndims 维数;Numel 元素个数;Size 指定维长度 3 数据类型

Matlab常用工具箱及常用函数

Matlab常用工具箱 MATLAB包括拥有数百个内部函数的主包和三十几种工具包.工具包又可以分为功能性工具包和学科工具包.功能工具包用来扩充MATLAB的符号计算,可视化建模仿真,文字处理及实时控制等功能.学科工具包是专业性比较强的工具包,控制工具包,信号处理工具包,通信工具包等都属于此类. 开放性使MATLAB广受用户欢迎.除内部函数外,所有MATLAB主包文件和各种工具包都是可读可修改的文件,用户通过对源程序的修改或加入自己编写程序构造新的专用工具包. Matlab Main Toolbox——matlab主工具箱 Control System Toolbox——控制系统工具箱 Communication Toolbox——通讯工具箱 Financial Toolbox——财政金融工具箱 System Identification Toolbox——系统辨识工具箱 Fuzzy Logic Toolbox——模糊逻辑工具箱 Higher-Order Spectral Analysis Toolbox——高阶谱分析工具箱 Image Processing Toolbox——图象处理工具箱 LMI Control Toolbox——线性矩阵不等式工具箱 Model predictive Control Toolbox——模型预测控制工具箱 μ-Analysis and Synthesis Toolbox——μ分析工具箱 Neural Network Toolbox——神经网络工具箱 Optimization Toolbox——优化工具箱 Partial Differential Toolbox——偏微分方程工具箱 Robust Control Toolbox——鲁棒控制工具箱 Signal Processing Toolbox——信号处理工具箱 Spline Toolbox——样条工具箱 Statistics Toolbox——统计工具箱 Symbolic Math Toolbox——符号数学工具箱 Simulink Toolbox——动态仿真工具箱 Wavele Toolbox——小波工具箱 常用函数Matlab内部常数[3] eps:浮点相对精度 exp:自然对数的底数e i或j:基本虚数单位 inf或Inf:无限大, 例如1/0 nan或NaN:非数值(Not a number),例如0/0 pi:圆周率p(= 3.1415926...) realmax:系统所能表示的最大数值 realmin:系统所能表示的最小数值 nargin: 函数的输入引数个数 nargout: 函数的输出引数个数 lasterr:存放最新的错误信息 lastwarn:存放最新的警告信息 MATLAB常用基本数学函数 abs(x):纯量的绝对值或向量的长度 angle(z):复数z的相角(Phase angle)

【方法】Matlab中常见数学函数的使用

【关键字】方法 给自己看的----Matlab的内部常数(转) 2008/06/19 14:01 [Ctrl C/V--学校 ] MATLAB基本知识 Matlab的内部常数 pi 圆周率 exp(1) 自然对数的底数e i 或j 虚数单位 Inf或inf 无穷大 Matlab的常用内部数学函数

没有发现matlab有这一命令,不过我们可以调用maple的命令,调用方法如下: 首先加载maple中的student函数库,加载方法为:maple(’with(student)’) 然后运行maple中的配方命令,格式为: maple(’completesquare(f)’)把f配方,其中f为代数表达式或代数方程 mapl e(’completesquare(f,x)’)把f按指定的变量x配方,其中f同上 maple(’completesquare(f,{x,y,...})’)把f按指定的变量x,y,...配方maple(’completesquare(f,[x,y,...])’)把f按指定的变量x,y,...配方, 如何用matlab进行多项式运算 (1)合并同类项 syms 表达式中包含的变量 collect(表达式,指定的变量) (2)因式分解 syms 表达式中包含的变量factor(表达式) (3)展开 syms 表达式中包含的变量 expand(表达式) 我们也可在matlab中调用maple的命令进行多项式的运算,调用格式如下: maple(’maple中多项式的运算命令’) 如何用matlab进行分式运算 发现matlab只有一条处理分式问题的命令,其使用格式如下: [n,d]=numden(f)把符号表达式f化简为有理形式,其中分子和分母的系数为整数且分子分母不含公约项,返回结果n为分子,d为分母。注意:f必须为符号表达式 不过我们可以调用maple的命令,调用方法如下: maple(’denom(f)’)提取分式f的分母 maple(’numer(f)’)提取分式f的分子 maple(’normal(f)’ ) 把分式f的分子与分母约分成最简形式 maple(’expand(f)’) 把分式f的分子展开,分母不变且被看成单项。 maple(’factor(f)’) 把分式f的分母和分子因式分解,并进行约分。 如何用Matlab进行因式分解 syms 表达式中包含的变量factor(表达式) 如何用Matlab展开 syms 表达式中包含的变量expand(表达式) 如何用Matlab进行化简 syms 表达式中包含的变量simplify(表达式) 如何用Matlab合并同类项 syms 表达式中包含的变量collect(表达式,指定的变量) 如何用Matlab进行数学式的转换 调用Maple中数学式的转换命令,调用格式如下: maple(‘Maple的数学式转换命令’)

完整word版,matlab各种函数大全

MATLAB函数表 管理命令和函数 help 在线帮助文件 doc 装入超文本说明 what M、MAT、MEX文件的目录列表type 列出M文件 lookfor 通过help条目搜索关键字which 定位函数和文件 Demo 运行演示程序 Path 控制MATLAB的搜索路径管理变量和工作空间 Who 列出当前变量 Whos 列出当前变量(长表) Load 从磁盘文件中恢复变量 Save 保存工作空间变量 Clear 从内存中清除变量和函数 Pack 整理工作空间内存 Size 矩阵的尺寸 Length 向量的长度 disp 显示矩阵或 与文件和操作系统有关的命令 cd 改变当前工作目录 Dir 目录列表 Delete 删除文件 Getenv 获取环境变量值 ! 执行DOS操作系统命令 Unix 执行UNIX操作系统命令并返回Diary 保存MATLAB任务 控制命令窗口 Cedit 设置命令行编辑 Clc 清命令窗口 Home 光标置左上角 Format 设置输出格式 Echo 底稿文件内使用的回显命令 more 在命令窗口中控制分页输出启动和退出MATLAB Quit 退出MATLAB Startup 引用MATLAB时所执行的M文件Matlabrc 主启动M文件 一般信息 Info MATLAB系统信息及Mathworks公Subscribe 成为MATLAB的订购用户hostid MATLAB主服务程序的识别代号Whatsnew 在说明书中未包含的新信息Ver 版本信息 操作符和特殊字符 + 加 —减 * 矩阵乘法 .* 数组乘法 ^ 矩阵幂 .^ 数组幂 \ 左除或反斜杠 / 右除或斜杠 ./ 数组除 Kron Kronecker张量积 : 冒号 ( ) 圆括号 [ ] 方括号 . 小数点 .. 父目录 …继续 , 逗号 ; 分号 % 注释 ! 感叹号 ‘转置或引用 = 赋值 = = 相等 < > 关系操作符 & 逻辑与 | 逻辑或 ~ 逻辑非 xor 逻辑异或 逻辑函数 Exist 检查变量或函数是否存在Any 向量的任一元为真,则其值为真All 向量的所有元为真,则其值为真Find 找出非零元素的索引号 三角函数 Sin 正弦 Sinh 双曲正弦 Asin 反正弦 Asinh 反双曲正弦 Cos 余弦 Cosh 双曲余弦 Acos 反余弦 Acosh 反双曲余弦 Tan 正切 Tanh 双曲正切 Atan 反正切 Atan2 四象限反正切

通信中常用的matlab库函数

信源函数 randerr 产生比特误差样本 randint 产生均匀分布的随机整数矩阵 randsrc 根据给定的数字表产生随机矩阵 wgn 产生高斯白噪声 信号分析函数 biterr 计算比特误差数和比特误差率 eyediagram 绘制眼图 scatterplot 绘制分布图 symerr 计算符号误差数和符号误差率 信源编码 compand mu律/A律压缩/扩 dpcmdeco DPCM(差分脉冲编码调制)解码dpcmenco DPCM编码 dpcmopt 优化DPCM参数 lloyds Lloyd法则优化量化器参数 quantiz 给出量化后的级和输出值 误差控制编码 bchpoly 给出二进制BCH码的性能参数和产生多项式convenc 产生卷积码 cyclgen 产生循环码的奇偶校验阵和生成矩阵cyclpoly 产生循环码的生成多项式 decode 分组码解码器 encode 分组码编码器 gen2par 将奇偶校验阵和生成矩阵互相转换gfweight 计算线性分组码的最小距离 hammgen 产生汉明码的奇偶校验阵和生成矩阵rsdecof 对Reed-Solomon编码的ASCII文件解码rsencof 用Reed-Solomon码对ASCII文件编码rspoly 给出Reed-Solomon码的生成多项式syndtable 产生伴随解码表 vitdec 用Viterbi法则解卷积码

(误差控制编码的低级函数) bchdeco BCH解码器 bchenco BCH编码器 rsdeco Reed-Solomon解码器 rsdecode 用指数形式进行Reed-Solomon解码 rsenco Reed-Solomon编码器 rsencode 用指数形式进行Reed-Solomon编码 调制与解调 ademod 模拟通带解调器 ademodce 模拟基带解调器 amod 模拟通带调制器 amodce 模拟基带调制器 apkconst 绘制圆形的复合ASK-PSK星座图 ddemod 数字通带解调器 ddemodce 数字基带解调器 demodmap 解调后的模拟信号星座图反映射到数字信号dmod 数字通带调制器 dmodce 数字基带调制器 modmap 把数字信号映射到模拟信号星座图(以供调制)qaskdeco 从方形的QASK星座图反映射到数字信号qaskenco 把数字信号映射到方形的QASK星座图 专用滤波器 hank2sys 把一个Hankel矩阵转换成一个线性系统模型hilbiir 设计一个希尔伯特变换IIR滤波器 rcosflt 升余弦滤波器 rcosine 设计一个升余弦滤波器 (专用滤波器的低级函数) rcosfir 设计一个升余弦FIR滤波器 rcosiir 设计一个升余弦IIR滤波器 信道函数 awgn 添加高斯白噪声 伽罗域计算

matlab常用解方程及方程组函数

1.roots求解多项式的根 r=roots(c) 注意:c为一维向量,者返回指定多项式的所有根(包括复根),poly和roots是互为反运算,还有就是roots只能求解多项式的解 还有下面几个函数poly2sym、sym2poly、eig >>syms x >>y=x^5+3*x^3+3; >>c=sym2poly(y);%求解多项式系数 >>r=roots(c); >>poly(r) 2.residue求留数 [r, p, k] = residue(b,a) >>b = [ 5 3 -2 7] >>a = [-4 0 8 3] >>[r, p, k] = residue(b,a) 3.solve符号解方程(组)——使用最多的 g = solve(eq1,eq2,...,eqn,var1,var2,...,varn) 注意:eqn和varn可以是符号表达式,也可以是字符串表达式,但是使用符号表达式时不能有“=”号,假如说varn没有给出,使用findsym函数找出默认的求解变量。返回的g是一个结构体,以varn为字段。由于符号求解的局限性,好多情况下可能得到空矩阵,此时只能用数值解法 解方程A=solve('a*x^2 + b*x + c') 解方程组B=solve('a*u^2 + v^2', 'u - v = 1', 'a^2 - 5*a + 6') 4.fzero数值求零点 [x,fval,exitflag,output]=fzero(fun,x0,options,p1,p2...) fun是目标函数,可以是句柄(@)、inline函数或M文件名 x0是初值,可以是标量也可以是长度为2的向量,前者给定一个位置,后者是给定一个范围 options是优化参数,通过optimset设置,optimget获取,一般使用默认的就可以了,具体参照帮助 p1,p2...为需要传递的其它参数

matlab里的一些函数

MATLAB-fminsearch函数的使用 fminsearch函数用来求解多维无约束的线性优化问题 用derivative-free的方法找到多变量无约束函数的最小值 语法 x = fminsearch(fun,x0) x = fminsearch(fun,x0,options) [x,fval] = fminsearch(...) [x,fval,exitflag] = fminsearch(...) [x,fval,exitflag,output] = fminsearch(...) 解释 fminsearch能够从一个初始值开始,找到一个标量函数的最小值。通常被称为无约束非线性优化 x = fminsearch(fun,x0) 从x0开始,找到函数fun中的局部最小值x,x0可以是标量,向量,矩阵。fun是一个函数句柄 x = fminsearch(fun,x0,options) 以优化参数指定的结构最小化函数,可以用optimset 函数定义这些参数。(见matlab help) [x,fval] = fminsearch(...)返回在结果x出的目标函数的函数值 [x,fval,exitflag] = fminsearch(...) 返回exitflag值来表示fminsearch退出的条件: 1--函数找到结果x 0--函数最大功能评价次数达到,或者是迭代次数达到 -1--算法由外部函数结束 [x,fval,exitflag,output] = fminsearch(...) 返回一个结构输出output,包含最优化函数的信息:output.algorithm 使用的优化算法 output.funcCount 函式计算次数 output.iterations 迭代次数 output.message 退出信息 另外

相关主题
文本预览
相关文档 最新文档