資源描述:
《Matlab - Numerical Analysis with MATLAB》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在學(xué)術(shù)論文-天天文庫。
1、
MATLABhasmanytoolsthatmakethispackagewellsuitedfornumericalcomputations.Thistutorialdealswiththerootfinding,interpolation,numericaldifferentiationandintegrationandnumericalsolutionsoftheordinarydifferentialequations.Numericalmethodsoflineara
2、lgebraarediscussedinTutorial4.
FunctionDescriptionabsAbsolutevaluedblquadNumericallyevaluatedoubleintegralerfErrorfunctionfevalExecutefunctionspecifiedbystringfzeroScalarnonlinearzerofindinggammaGammafunctioninlineConstructINLINEobjectinterp1One-dimensionali
3、nterpolationinterp2Two-dimensionalinterpolationlinspaceEvenlyspacedvectormeshgridXandYarraysfor3-DplotsnormMatrixorvectornormode23Solvenon-stiffdifferentialequationsode45Solvenon-stiffdifferentialequationsode113Solvenon-stiffdifferentialequationsode15sSolvestiffdifferentialequationsode2
4、3sSolvestiffdifferentialequationspolyConvertrootstopolynomialpolyvalEvaluatepolynomialppvalEvaluatepiecewisepolynomialquadNumericallyevaluateintegral,lowordermethodquad8Numericallyevaluateintegral,higherordermethodrcondReciprocalconditionestimatorrootsFindpolynomialrootssplineCubicsplin
5、edatainterpolationsurf3-DcoloredsurfaceunmkppSupplydetailsaboutpiecewisepolynomial2!"#Acentralproblemdiscussedinthissectionisformulatedasfollows.Givenareal-valuedfunctionnnf:,n1,findavectorrsothatf(r)=0.Vectorriscalledtherootorzerooff.5.2.1Computingrootsoftheunivariatepolyn
6、omialsPolynomialsarerepresentedinMATLABbytheircoefficientsinthedescendingorderofpowers.32Forinstance,thecubicpolynomialp(x)=3x+2x-1isrepresentedasp=[3201];Itsrootscanbefoundusingfunctionrootsformatlongr=roots(p)r=-1.000000000000000.16666666666667+0.55277079839257i0.16666666666667-0.5527
7、7079839257iTocheckcorrectnessofthisresultweevaluatep(x)atrusingfunctionpolyvalerr=polyval(p,r)err=1.0e-014*0.222044604925030+0.01110223024625i0-0.01110223024625iToreconstructapolynomialfromitsrootsonecanusefunctionpoly.Usingtherootsrcomputedearlierweobtainpoly(r)ans=1.000000000