Technical Analysis and Applications with MATLAB

上传人:g****l 文档编号:54077126 上传时间:2018-09-07 格式:PPT 页数:661 大小:4.81MB
返回 下载 相关 举报
Technical Analysis and Applications with MATLAB_第1页
第1页 / 共661页
Technical Analysis and Applications with MATLAB_第2页
第2页 / 共661页
Technical Analysis and Applications with MATLAB_第3页
第3页 / 共661页
Technical Analysis and Applications with MATLAB_第4页
第4页 / 共661页
Technical Analysis and Applications with MATLAB_第5页
第5页 / 共661页
点击查看更多>>
资源描述

《Technical Analysis and Applications with MATLAB》由会员分享,可在线阅读,更多相关《Technical Analysis and Applications with MATLAB(661页珍藏版)》请在金锄头文库上搜索。

1、1,Chapter 1 MATLAB Primer,This introductory chapter is relatively short and has as its main objective the introduction of MATLAB to the reader. This early introduction has the purpose of familiarizing the reader with the basic operations of MATLAB so that the program may be used throughout the book

2、to support the mathematical analysis.,2,Desktop Layout,The screen shown on the next slide is based on Version7, Release 14. The Student Version of MATLAB comes with the Symbolic Mathematics Toolbox and the program Simulink. All examples in the text should work with the Student Version,3,4,Prompt,MAT

3、LAB automatically inserts the prompt at the beginning of each line in the Command Window of the Professional Version. The corresponding prompt for the Student Version is EDU. We will assume the shorter prompt of the Professional Version throughout the text and the presence of the prompt on a line wi

4、ll alert the reader to the fact that a MATLAB command and possible results will follow.,5,Command Window,The Command Window may be used on an interactive basis by simply typing in the commands after for the Professional Version or after EDU for the Student Version on a line-by-line basis. Depress En

5、ter on the keyboard after each line is entered, and any results generated by the command will immediately appear on the screen unless the addition of a semicolon has suppressed the display or unless the command is part of a sequence.,6,Notational Conventions,In the MATLAB examples, we will usually d

6、isplay the results exactly as they appear on the screen. This means that the type style will be different from the standard mathematical style in the remainder of the book, but the symbols should be perfectly clear. Standard mathematical notation includes italicized symbols with subscripts and/or su

7、perscripts but MATLAB notation will be non-italicized without subscripts or superscripts.,7,Command Window versus M-files,The Command Window will allow you to work in a manner similar to that of a calculator. You can enter a command and see the numerical results immediately. The important thing is t

8、hat it is interactive. This is in contrast to the writing of M-files, which is performed in a different window. An M-file is a form of computer program.,8,Clear Commands,Clearing the screen: clcClearing all variables: clearClearing a variable x: clear x,9,Spacing,Blank spaces between distinct sectio

9、ns of a command line may be used to avoid a “crowded” appearance provided that they dont disrupt a particular command function or number. Thus, x=5 , x = 5, and x = 5 are all acceptable. However, if the number is 51, you will get an error message if you try to put a space between the 5 and the 1. Li

10、kewise a variable x1 cannot be expressed as x 1.,10,Basic Arithmetic Operations,In many of the slides that follow, basic arithmetic operations will be employed using simple numbers to illustrate the manner in which the command window can be used in much the same way as a calculator. To save space on

11、 the slides, many of the blank lines that appear on the computer screen will be eliminated.,11,Entering Numbers, 5 ans =5 x = 5 x =5 y = 3 y =3,12,Addition and Subtraction, z1 = 5 + 3 z1 =8 z1 = x + y z1 =8 z2 = y - x z2 =-2,13,Checking on the Variables, whos Name Size Bytes Classx 1x1 8 double arra

12、yy 1x1 8 double arrayz1 1x1 8 double arrayz2 1x1 8 double arrayThis information may also be found in the Current Directory window.,14,Multiplication,Multiplication is performed by placing an asterisk (*) between the numbers. z3 = 5*3 z3 =15 z3 = x*y z3 =15,15,Division,Division of x by y is performed

13、 as follows: z4 = x/y z4 =1.6667An alternate form is as follows: z4 = yx z4 =1.6667,16,Exponentiation,Exponentiation is performed by using the symbol (). z5 = x2 z5 =25,17,Suppressing the Listing of Results,If it is desired to perform a computation and not show it on the screen, the command should b

14、e followed by a semicolon (;). For example, z6 = yx; The value is in memory and may be seen by entering the variable name. z6 z6 =243,18,Entering in Exponential Form,A microwave frequency of 15 GHz (1 GHz = 109 Hz) may be entered as f = 15e9 f =1.5000e+010 Boltzmanns constant k = 1.38x10-23 J/K may

15、be entered as k = 1.38e-23 k =1.3800e-023,19,Square Root, z7 = sqrt(x) z7 =2.2361,20,Hierarchy,Without parentheses, the normal hierarchy of arithmetic operations is exponentiation, multiplication, division, addition, and subtraction. Parentheses may be used to change the order. When in doubt, it is

16、prudent to add parentheses to ensure that the order is performed properly. The process of placing parentheses within parentheses is called nesting.,21,Consider the algorithm shown below.,1. Add 3 to x. 2. Square the result of step 1. 3. Multiply the result of step 2 by 6. 4. Add 8 to the result of step 3. 5. Take the square root of step 4 and the value obtained is y.,

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 其它中学文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号