Danh mục

Lecture note Data visualization - Chapter 21

Số trang: 21      Loại file: pptx      Dung lượng: 2.17 MB      Lượt xem: 5      Lượt tải: 0    
Xem trước 3 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

The main contents of the chapter consist of the following: Script m-file, editor/debugger window, cell mode, using built-in functions, using the HELP feature , window HELP screen, elementary math functions, rounding functions, discrete mathematics, trigonometric function, data analysis function.
Nội dung trích xuất từ tài liệu:
Lecture note Data visualization - Chapter 21Lecture21RecapScriptMfileEditor/DebuggerWindowCellModeChapter3“BuiltinMATLABFunction” UsingBuiltinFunctions UsingtheHELPFeature WindowHELPScreen ElementaryMathFunctions RoundingFunctionsSumsandProductsSortingValuesMatrixSizeVarianceandStandardDeviationNormalDistributionRandomNumbersRandomnumbersareoftenusedinengineering calculationstosimulatemeasureddataMeasureddatararelybehaveexactlyaspredictedby mathematicalmodels,sowecanaddsmallvaluesof randomnumberstoourpredictionstomakeamodel behavemorelikearealsystemRandomnumbersarealsousedtomodelgamesofchanceTwodifferenttypesofrandomnumberscanbegenerated inMATLAB: Uniformrandomnumbers GaussianrandomnumbersUniformRandomNumbersUniformrandomnumbersaregeneratedwiththerand function.Thesenumbersareevenlydistributedbetween0 and1Wecancreateasetofrandomnumbersoverotherranges bymodifyingthenumberscreatedbytherandfunctionForexample: tocreateasetof100evenlydistributednumbers between0and5 firstcreateasetoverthedefaultrangewiththe command r=rand(100,1);ExampleContinued…. Ifwewanttochangetherangeto5to10,wecan add5toeveryvalueinthearray: r=r+5; Theresultwillberandomnumbersvaryingfrom5 to10. Wecangeneralizetheseresultswiththeequation x=(maxmin).random_number_set+minGaussianRandomNumbersContinued….Ifweneedadatasetwithadifferentaverageora differentstandarddeviation,westartwiththedefaultset ofrandomnumbersandthenmodifyitSincethedefaultstandarddeviationis1,wemust multiplybytherequiredstandarddeviationforthenew datasetSincethedefaultmeanis0,we’llneedtoaddthenew mean: x=standard_deviation.random_data_set+meanForexample:tocreateasequenceof500Gaussian randomvariableswithastandarddeviationof2.5andaComplexNumbersMATLABincludesseveralfunctionsusedprimarilywith complexnumbersComplexnumbersconsistoftwoparts arealcomponent animaginarycomponentForexample: 5+3i isacomplexnumber.Thereal componentis5,andtheimaginarycomponentis3.ComplexnumberscanbeenteredintoMATLABintwo ways: Continued….AsisstandardinMATLAB,theinputtothecomplex functioncanbeeithertwoscalarsortwoarraysofvaluesThus,ifxandyaredefinedas x=1:3; y=[1,5,12];thenthecomplexfunctioncanbeusedtodefineanarray ofcomplexnumbersasfollows: complex(x,y)ans=realandimagFunctionTherealandimagfunctionscanbeusedtoseparatethe realandimaginarycomponentsofcomplexnumbersForexample:forA=5+3*i,wehave real(A) ans= 5 imag(A) ans= 3isrealFunctionTheisrealfunctioncanbeusedtodeterminewhethera variableisstoringacomplexnumberItreturnsa1ifthevariableisrealanda0ifitiscomplexSinceAisacomplexnumber,weget isreal(A) ans=0Thus,theisrealfunctionisfalseandreturnsavalueof0ConjugateofComplexNumberThecomplexconjugateofacomplexnumberconsistsof thesamerealcomponent,butanimaginarycomponentof theoppositesignTheconjfunctionreturnsthecomplexconjugate: conj(A) ans=5.00003.0000iThetransposeoperatoralsoreturnsthecomplexconjugate ofanarray,inadditiontoconvertingrowstocolumnsand columnstorowsThus,wehave

Tài liệu được xem nhiều: