外文文献及翻译MATLAB 介绍.doc

上传人:文库蛋蛋多 文档编号:2325090 上传时间:2023-02-11 格式:DOC 页数:12 大小:207KB
返回 下载 相关 举报
外文文献及翻译MATLAB 介绍.doc_第1页
第1页 / 共12页
外文文献及翻译MATLAB 介绍.doc_第2页
第2页 / 共12页
外文文献及翻译MATLAB 介绍.doc_第3页
第3页 / 共12页
外文文献及翻译MATLAB 介绍.doc_第4页
第4页 / 共12页
外文文献及翻译MATLAB 介绍.doc_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《外文文献及翻译MATLAB 介绍.doc》由会员分享,可在线阅读,更多相关《外文文献及翻译MATLAB 介绍.doc(12页珍藏版)》请在三一办公上搜索。

1、外文原文Introduction to MATLABMATLAB (short for Matrix Laboratory) is a special-purpose computer program optimized to perform engineering and scientific calculations. It started life has a program designed to perform matrix mathematics, but over the years it has grown into a flexible computing system ca

2、pable of solving essentially any technical problem.The MATLAB program implements the MATLAB programming language and provides an extensive library of predefined functions that make technical programming tasks easier and more efficient. This book introduces the MATLAB language and shows how to use it

3、 to solve typical technical problems.MATLAB is a huge program, with an incredibly rich variety of functions. Even the basic version of MATLAB without any toolkits is much richer than other technical programming languages. There are more than 1000 functions in the basic MATLAB product alone,and the t

4、oolkits extend this capability with many more functions in various specialties. This book makes no attempt to introduce the user to all of MALTLABs own tools to locate the correct function for a specific purpose from the enormous choice available.Advantages of MATLAB MATLAB has many advantages compa

5、red with conventional computer languages for technical problem solving. Among them are the following:1. Ease of UseMATLAB is an interpreted language, like many versions of Basic. Like Basic, it is very easy to use. The program can be used as a scratch pad to evaluate expressions typed at the command

6、 line, or it can be used to execute large prewritten programs. Programs may be easily written and modified with the built-in integrated development environment, and debugged with the MATLAB debugger. Because the language is so easy to use, it is ideal for educational use, and for the rapid prototypi

7、ng of new programs. Many program development tools are provided to make the program easy to use. a workspace browser, and extensive demos.2. Platform independence MATLAB is supported on many different computer systems, providing a large measure of platform independence. At the time of this writing,

8、the language is supported on windows 9x/NT/2000 and many different versions of UNIX. Programs written on any platform will run on all of the other platforms, and data files written on any platform may be read transparently on any other platforms, AS a result,Programs written in MATLAB can migrate to

9、 new platforms when the needs of the user change.3. Predefined FunctionsMATLAB comes complete with an extensive library of predefined functions that provide tested and prepackaged solutions to many basic technical tasks. For example, suppose that you are writing a program that must calculate the sta

10、tistics associated with an input data set. In most languages, you would need to write your own subroutines or functions to implement calculations such as the arithmetic mean, standard deviation, median, and so forth. These and hundreds of other functions are built right into the MATLAB language, mak

11、ing your job much easier.In addition to the large library of functions built into the basic MATLAB language, many special-purpose toolboxes are available to help solve complex problems in specific areas. For example, a user can buy standard toolboxes to solve problems in Signal Processing, Control S

12、ystems, Communications, Image Processing, and Neural Networks, among many others. There is also an extensive collection of free user-contributed MATLAB programs that are shared through the MATLAB Web site.4. Device-Independent PlottingUnlike most other computer languages, MATLAB has many integral pl

13、otting and imaging commands. The plots and images can be displayed on any graphical output device supported by the computer on which MATLAB is running. This capability makes MATLAB an outstanding tool for visualizing technical data.5. Graphical User InterfaceMATLAB includes tools that allow a progra

14、mmer to interactively construct a graphical user interface (GUI) for his or her program. With this capability, the programmer can design sophisticated data analysis programs that can be operated by relatively inexperienced users.6. MATLAB CompilerMATLABs flexibility and platform independence is achi

15、eved by compiling MATLAB programs into a device-independence p-code, and then interpreting the p-code instructions at run time. This approach is similar to that used by Microsoft is Visual Basic language. Unfortunately, the resulting programs can sometimes execute slowly because the MATLAB code is i

16、nterpreted rather than compiled. We will point out features that tend to slow program execution when we encounter them. A separate MATLAB compiler is available. This compiler can compile a MATLAB program into a true executable that runs faster than the interpreted code. It is a great way to convert

17、a prototype MATLAB program into an executable suitable for sale and distribution to users.Disadvantages of MATLAB MATLAB has two principal disadvantages. The first is that it is an interpreted language, and therefore can execute more slowly than compiled languages. This problem can be mitigated by p

18、roperly structuring the MATLAB program and by the use of the MATLAB compiler to compile the final MATLAB program before distribution and general use.The second disadvantage is cost: A full copy of MATLAB is 5 to 10 times more expensive than a conventional C or Fortran compiler. This relatively high

19、cost is more than offset by the reduced time required for an engineer or scientist to create a working program, so MATLAB is cost-effective for businesses. However, it is too expensive for most individuals to consider purchasing. Fortunately, there is also an inexpensive Student Edition of MATLAB, w

20、hich is a great tool for students wanting to learn the language. The Student Edition of MATLAB is essentially identical to the full edition.With the introduction of branches and loops, our programs are going to become more complex, and it will get easier to make mistakes. To help avoid programming e

21、rrors, we will introduce a formal program design procedure based on the technique known as top-down design. We will also introduce a common algorithm development tool known as pseudo code.Introduction To Top-Down Design TechniquesSuppose that you are an engineer working in industry, and that you nee

22、d to write a program to solve some problem. How do you begin? When given anew problem, there is a natural tendency to sit down at a keyboard and start programming without “wasting” a lot of time thinking about the problem first. It is often possible to get away with this “on the fly” approach to pro

23、gramming for very small problems, such as many of the examples in this book. In the real world, however, problems are larger, and a programmer attempting this approach will become hopelessly bogged down. For larger problems, it pays to completely think out the problem and the approach you are going

24、to take to it before writing a single line of code. We introduce a formal program design process in this section, and then apply that process to every major application developed in the remainder of the book. For some of the simple examples that we will be doing, the design process will seem like ov

25、erkill; however, as the problems that we solve get larger and larger, the process becomes more and more essential to successful programming.When I was an undergraduate, one of my professors was fond of saying, “programming is easy. It is knowing what to program that is hard.” his point was forcefull

26、y driven home to me after I left university and began working in industry on larger scale software projects. I found that the most difficult port of my job was to understand the problem I was trying to solve. Once I really understood the problem, it became easy to break the problem apart into smalle

27、r, more easily manageable pieces with well-defined functions, and then to tackle those pieces one at a time.Top-down design is the process of starting with a large task and breaking it down into smaller, more easily understandable pieces, which perform a portion of the desired task. Each subtask may

28、 in turn be subdivided into smaller subtasks if necessary. Once the program is divided into small pieces, each piece can be coded and tested independently. We do not attempt to combine the subtasks into a complete task until each of the subtasks has been verified to work properly by itself.The conce

29、pt of top-down design is the basis of our formal program design process. We will now introduce the details of the process, which is illustrated in figure 1 the steps involved are:1. Clearly state the problem that you are trying to solve.Programs are usually written to fill some perceived need, but t

30、hat need may not be articulated clearly by the person requesting the program. For example, a user may ask for a program to solve a system of simultaneous linear equations. This request is not clear enough to allow a programmer to design a program to meet the need; he or she must first know much more

31、 about the problem to be solved. Is the system of equations to be solved real or complex? What is the maximum number of equations and unknown that the program must handle? Are there any symmetry in the equations that might be exploited to make the task easier? The program designer will have to talk

32、with the user requesting the program, and the two of them will have come up with a clear statement of exactly what they are trying to accomplish. A clear statement of the problem will prevent misunderstandings, and it will also help the program designer to properly organize his or her thoughts. In t

33、he example we were describing, a proper statement of the problem might have been: Figure 1Design and write a program to solve a system of simultaneous linear equations having real coefficients and with up to 20 equations in 20 unknowns.2. Define the inputs required by the program and the outputs to

34、be produced by the program.The inputs to the program and the outputs produced by the program must be specified so that the new program will properly fit into the overall processing scheme. In this example, the coefficients of the equations to be solved are probably in some pre-existing order, and ou

35、r new program needs to be able to read them in that order. And our new program needs to be able to read them in that order. Similarly, it needs to produce the answers required by the programs that may follow it in the overall processing scheme, and to write out those answers in the format needed by

36、the programs following it.3. Design the algorithm that you intend to implement in the program.An algorithm is a step-by-step procedure for finding the solution to a problem. It is at this stage in the process that top-down design techniques come into play. The designer looks for logical divisions wi

37、thin the problem, and divides it up into subtasks along those lines. This process is called decomposition. If the subtasks are large, the designer can break them up into even smaller sub-tasks. This process continues until the problem has been divided into many small pieces, each of which does a sim

38、ple, clearly understandable job.After the problem has been decomposed into small pieces, each piece is further refined through a process called stepwise refinement. In stepwise refinement, a designer starts with a general description of what the piece of code should do, and then defines the function

39、s of the piece in greater and greater detail until they are specific enough to be turned into MATLAB statements. Stepwise refinement is usually done with pseudo code, which will be described in the next section.It is often helpful to solve a simple example of the problem by hand during the algorithm

40、 development process. If the designer understands the steps that he or she went through in solving the problem by hand, then he or she will be better able to apply decomposition and stepwise refinement to the problem.4. Turn the algorithm into MATLAB statements.If the decomposition and refinement pr

41、ocess was carried out properly, this step will be very simple. All the programmer will have to do is to replace pseudo code with the corresponding MATLAB statements on a one-for-one basis.5. Test the resulting MATLAB programThis step is the real killer. The components of the program must first be te

42、sted individually, if possible, and then the program as a whole must be tested. When testing a program, we must verify that it works correctly for all legal input data sets. It is very common for a program to be written, tested with some standard data set, and released for use, only to find that it

43、produces the wrong answers (or crashes) with a different input data set. If the algorithm implemented in a program includes different branches, we must test all of the possible branches to confirm that the program operates correctly under every possible circumstance.Large programs typically go throu

44、gh a series of tests before they are released for general use (see Figure 2). The first stage of testing is sometimes called unit testing. During unit testing, the individual subtasks of the program are tested separately to confirm that they work correctly. After the unit testing is completed, the p

45、rogram goes through a series of builds, during which the individual subtasks are combined to produce the final program. The first build of the program typically includes only a few of the subtasks. It is used to check the interactions among those subtasks and the functions performed by the combinati

46、ons of the subtasks. In successive builds, more and more subtasks are added, until the entire program is complete. Testing is performed on each build, and any errors(bugs) detected are corrected before moving on to the next build. Figure 2中文翻译MATLAB 介绍MATLAB (矩阵实验室的简称)是一种专业的计算机程序,用于工程科学的矩阵数学运算。但在以后的

47、几年内,它逐渐发展为一种极其灵活的计算体系,用于解决各种重要的技术问题。MATLAB 程序执行MATLAB 语言,并提供了一个极其广泛的预定义函数库,这样就使得技术工作变得简单高效。本书将介绍MATLAB 语言,并向大家展示如何运用它去解决经典的技术问题。MATLAB 是一个庞大的程序,拥有难以置信的各种丰富的函数;即使基本版本的MATLAB 语言拥有的函数也比其他的工程编程语言要丰富的多。基本的MATLAB 语言已经拥有了超过1000 多个函数,而它的工具包带有更多的函数,由此扩展了它在许多专业领域的能力。本书无意将MATLAB 的所有函数介绍给大家,而是让大家掌握编写调试和优化程序的基本功

48、,还有一些重要函数的子集。所以从大量可利用的函数中筛选出你所需要的函数就显得尤为重要。MATLAB 的优点MATLAB 语言相对于传统的科技编程语言有诸多的优点。主要包括:1.易用性MATLAB 是种解释型语言,就像各种版本的BASIC。和BASIC 一样,它简单易用程序可用作便笺簿求打在命令行处表达式的值,也可执行预先写好的大型程序。在MATLAB 集成开发环境下,程序可以方便的编写,修改和调试。这是因为这种语言极易使用,对于教育应用和快速建立新程序的原型,它是一个理想的工具。许多的编程工具使得 MATLAB 十分简单易用。这些工具包括:一个集成的编译/调试器,在线文件手册,工作台和扩展范例

49、。2.平台独立性MATLAB 支持许多的操作系统,提供了大量的平台独立的措施。在本书编写的时侯, windows98/2000/NT 和许多版本的UNIX 系统都支持它。在一个平台上编写的程序,在其它平台上一样可以正常运行,在一个平台上编写的数据文件在其它平台上一样可以编译。因此用户可以根据需要把MATLAB 编写的程序移植到新平台。3.预定义函数MATLAB 带有一个极大的预定义函数库,它提供了许多已测试和打包过的基本工程问题的函数。例如,假设你正在编写一个程序,这个程序要求你必须计算与输入有关的统计量。在许多的语言中,你需要写出你所编数组的下标和执行计算所需要的函数,这些函数包括其数学意义,中值,标准误差等。像这样成百上千的函数已经在MATLAB 中编写好,所以让编程变得更加简单。除了植入MATLAB 基本语言中的大量函数,还有许多专用工具箱,以帮助用户解决在具体领域的复杂问题。例如,用户可以购买标准的工具箱以解决在

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号