2022年毕设翻译 .pdf

上传人:H****o 文档编号:39718687 上传时间:2022-09-07 格式:PDF 页数:22 大小:440.53KB
返回 下载 相关 举报
2022年毕设翻译 .pdf_第1页
第1页 / 共22页
2022年毕设翻译 .pdf_第2页
第2页 / 共22页
点击查看更多>>
资源描述

《2022年毕设翻译 .pdf》由会员分享,可在线阅读,更多相关《2022年毕设翻译 .pdf(22页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、1 中文译文一 MATLAB 介绍MATLAB(矩阵实验室的简称)是一种专业的计算机程序,用于工程科学的矩阵数学运算。但在以后的几年内,它逐渐发展为一种极其灵活的计算体系,用于解决各种重要的技术问题。MATLAB 程序执行 MATLAB 语言,并提供了一个极其广泛的预定义函数库,这样就使得技术工作变得简单高效。本书将介绍MATLAB 语言,并向大家展示如何运用它去解决经典的技术问题。MATLAB 是一个庞大的程序,拥有难以置信的各种丰富的函数;即使基本版本的 MATLAB 语言拥有的函数也比其他的工程编程语言要丰富的多。基本的MATLAB 语言已经拥有了超过 1000 多个函数,而它的工具包带

2、有更多的函数,由此扩展了它在许多专业领域的能力。本书无意将MATLAB 的所有函数介绍给大家,而是让大家掌握编写调试和优化程序的基本功,还有一些重要函数的子集。所以从大量可利用的函数中筛选出你所需要的函数就显得尤为重要。MATLAB 的优点MATLAB 语言相对于传统的科技编程语言有诸多的优点。主要包括:1.易用性MATLAB 是种解释型语言,就像各种版本的BASIC。和 BASIC 一样,它简单易用程序可用作便笺簿求打在命令行处表达式的值,也可执行预先写好的大型程序。在 MATLAB 集成开发环境下,程序可以方便的编写,修改和调试。这是因为这种语言极易使用,对于教育应用和快速建立新程序的原型

3、,它是一个理想的工具。许多的编程工具使得MATLAB 十分简单易用。这些工具包括:一个集成的编译/调试器,在线文件手册,工作台和扩展范例。2.平台独立性MATLAB 支持许多的操作系统,提供了大量的平台独立的措施。在本书编写的时侯,windows98/2000/NT 和许多版本的 UNIX 系统都支持它。在一个平台上编写的程序,在其它平台上一样可以正常运行,在一个平台上编写的数据文件在其它平台上一样可以编译。因此用户可以根据需要把MATLAB 编写的程序名师资料总结-精品资料欢迎下载-名师精心整理-第 1 页,共 22 页 -2 移植到新平台。3.预定义函数MATLAB 带有一个极大的预定义函

4、数库,它提供了许多已测试和打包过的基本工程问题的函数。例如,假设你正在编写一个程序,这个程序要求你必须计算与输入有关的统计量。在许多的语言中,你需要写出你所编数组的下标和执行计算所需要的函数,这些函数包括其数学意义,中值,标准误差等。像这样成百上千的函数已经在 MATLAB 中编写好,所以让编程变得更加简单。除了植入 MATLAB 基本语言中的大量函数,还有许多专用工具箱,以帮助用户解决在具体领域的复杂问题。例如,用户可以购买标准的工具箱以解决在信号处理,控制系统,通信,图象处理,神经网络和其他许多领域的问题。4.机制独立的画图与其他语言不同,MATLAB 有许多的画图和图象处理命令。当MAT

5、LAB 运行时,这些标绘图和图片将会出现在这台电脑的图像输出设备中。此功能使得MATLAB 成为一个形象化技术数据的卓越工具。5.用户图形界面MATLAB 允许程序员为他们的程序建立一个交互式的用户图形界面。利用MATLAB 的这种功能,程序员可以设计出相对于无经验的用户可以操作的复杂的数据分析程序。6.MATLAB 编译器MATLAB 的灵活性和平台独立性是通过将MATLAB 代码编译成设备独立的P 代码,然后在运行时解释 P 代码来实现的。这种方法与微软的VB 相类似。不幸的是,由于 MATLAB 是解释性语言,而不是编译型语言,产生的程序执行速度慢。当我们遇到执行速度慢的程序时,我们将会

6、指出其这一特性。MATLAB 的缺点MATLAB 有两个基本的缺点。第一,它是解释型语言,其执行速度要比编译型语言慢得多。这个问题可以通过合理的 MATLAB 结构得到缓解,也可以在发行广泛使用前编译出MATLAB 程序。第二,他的费用较高。一个完全版 MATLAB 编译器的大小是一个 C 语言或名师资料总结-精品资料欢迎下载-名师精心整理-第 2 页,共 22 页 -3 Fortan 语言编译器的 5 到10倍。但MATLAB 能够节省大量的时间在科技编程方面,故MATLAB 在商业编程过程中是节省成本的。尽管如此,相对于大多数考虑购买的人还是很昂贵的。幸运的是,它有一个价格便宜的学生专用版

7、本,对学生来说它是学习 MATLAB 语言的一个重要工具。学生版的 MATLAB 和完全版的MATLAB 是基本一致的。随着选择和循环介绍,我们的程序也将变得复杂,对于解决问题来说,将会变得简单。为了帮助大家避免在编程过程中出现大量的错误,我们将向大家介绍正式的编程步骤,即自上而下的编程方法。我们也会向大家介绍一些普通的算法开发工具即伪代码。自上而下的编程方法简介假设你是在工厂工作的工程师,为了解决某些问题,你要编写一个程序。你如何开始呢?当遇到一个新问题时,我们的心里会自然而然的产生这样的想法:马上坐在计算机前,开始编程,而不用浪费大量的时间思考我们所要解决的问题是什么?用这种不切实际的想法

8、来编一些非常小的程序可能会成功。但在现实中,问题可能会非常的大,程序员再用这种方法编程将会陷入困境。对于一个大的程序来说,在编写代码之前你要通盘的思考你所要面临的问题和解决的方法。在本节中,我们将向大家介绍正式的编程设计步骤,然后应用这个步骤来编写本书所有的大的应用程序。对于我们所遇到一些简单的例子来说,这个步骤好像有些画蛇添足。但是当我们解决的问题变得越来越大的时侯,这个步骤将会变得异常重要。当我还没有毕业的时侯,一个教授喜欢说:“编程很简单,因为我知道在编程的过程的困难”。当我们离开学校,在工厂从事于大规模软件工程编写时,我深深地理解了它所说的话。我发现在工作中我遇到的大多数困难都是对所要

9、解决问题的理解。一旦你真正理解了问题,你就会把这个问题分解成许多小的问题,更加易于管理的小块,然后逐一解决某一个小块。自上而下的编程方法是我们正规编程设计的基础。我们现在向大家介绍这些在图1 说明的步骤细节。步骤如下:1.清晰地陈述你所要解决的问题编写的程序大多数情况下要满足一些感觉上的需要,但这种需要不一定能够被人清晰地表达出来。例如,用户需要一个解线性方程组的表达式。像这样的要求就不够清楚,程序员就很难编出一个使他满意的程序。他必须弄清楚要有多少名师资料总结-精品资料欢迎下载-名师精心整理-第 3 页,共 22 页 -4 问题需要解决?在这些方程式中有没有对称的形式使我们的开发变得简单?程

10、序设计者必须和使用者讨论所需的程序,他们必须要对完成的任务有一个精确细致的描述。对问题清晰的描述可以防止误解,并且能够帮助程序员合理的组织他的思想。上面的例子对问题合适的陈述应为:设计一个用于解决联立线性方程组的程序,这些方程中未知数的系数为实数,最多有20 个未知数。2.定义程序所需的输入量和程序所产生的输出量指定输入量和输出量,只有这样新的程序才能适应全过程计划。在这个例子中方程式的系数可能有其预先存在的顺序,我们的新程序必须能按照顺序读取它们。相似地,也需要产生出这个程序所要求的结果,即输出量,我们还要以一定的格式打印出来。3.设计你的程序得以实现的算法图 1 算法是指为某个问题找到答案

11、一步接一步的程序。在这个阶段自上而下的编名师资料总结-精品资料欢迎下载-名师精心整理-第 4 页,共 22 页 -5 程方法发挥了作用。编程设计者开始对这个问题进行逻辑划分,把它逐步分解为一个又一个子工作。这个过程叫做分解(decomposition)。如果一些子工作还是比较大,设计者还可以把他它分解成更小的块。这个过程将会继续到问题被分解成许多简单且易理解的小块为止。在问题被分解成小块之后,每一个小块要被进一步的求精,这个过程叫做逐步求精(stepwise refinement)。在这个过程中,设计者开始于对本小块代码总括性的描述,然后开始一步一步地定义所需的函数,越来越具体,直到他能够转化

12、为MATLAB 语句。逐步求精的过程中,我们要用到的伪代码将会在下节为大家介绍。在算法开发过程中,这个方法是非常有用的。如果设计者真正理解了解决问题这个些步骤,他将会对问题进行分解和逐步求精。4.把算法转化为代码如果分解和逐步求精的过程已经顺利完成,那么这一步将会异常地简单。所有程序员都会将伪代码一句一句地转化为合适地MATLAB 语句。5.检测产生的 MATLAB 程序这一步是真正的拦路虎。首先,程序的每一部分将会被单独地检测,如果有可能的话,整个程序还要被检测一遍。在我们检测程序时,我们必须证明所有合法输入数据值都能够正常运行。用标准的输入值检测程序,看它是否产生了值。如果在一个程序中执行

13、的算法包含了不同的分支,你必须检测每一个分支,以保证产生正确的答案。大程序在交付大众使用之前,必须经过一系列地检测(图2)。检测的第一步有时被称为单元检测(unittesting)。在单元检测过程中,程序的子程序将会被独立地检测以证明它的正确性。当单元检测结束之后,这个程序将进行一系列的组合,把独立的子程序联合产生出最后的程序。程序第一步的联合通常只包括很少的子程序。通过组合这些子程序,经常用检查子程序或函数之间的联系。在一系列地组合过程中,越来越多的子程序被加了进来,直到整个程序的完成。在每一次组合的过程中,每一个错误都会被发现并在进行下一次组合之前纠正过来。名师资料总结-精品资料欢迎下载-

14、名师精心整理-第 5 页,共 22 页 -6 图 2 名师资料总结-精品资料欢迎下载-名师精心整理-第 6 页,共 22 页 -7 外文原文Introduction to MATLAB MATLAB(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

15、over the years it has grown into a flexible computing system capable 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.Th

16、is book introduces the MATLAB language and shows how to use it 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

17、 1000 functions in the basic MATLAB product alone,and the toolkits extend this capability with many more functions in various specialties.This book makes no attempt to introduce the user to all of MALTLAB s own tools to locate the correct function for a specific purpose from the enormous choice avai

18、lable.Advantages of MATLAB MATLAB has many advantages compared with conventional computer languages for technical problem solving.Among them are the following:1.Ease of Use MATLAB is an interpreted language,like many versions of Basic.Like Basic,it is very easy to use.The program can be used as a sc

19、ratch pad to evaluate expressions typed at the command 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

20、 for educational use,and for the rapid prototyping of new programs.名师资料总结-精品资料欢迎下载-名师精心整理-第 7 页,共 22 页 -8 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

21、,providing a large measure of platform independence.At the time of this writing,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

22、 on any other platforms,AS a result,Programs written in MATLAB can migrate to new platforms when the needs of the user change.3.Predefined Functions MATLAB comes complete with an extensive library of predefined functions that provide tested and prepackaged solutions to many basic technical tasks.For

23、 example,suppose that you are writing a program that must calculate the statistics 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 hund

24、reds of other functions are built right into the MATLAB language,making 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 sta

25、ndard toolboxes to solve problems in Signal Processing,Control Systems,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 Plotting Unlike

26、 most other computer languages,MATLAB has many integral plotting and imaging commands.The plots and images can be displayed on any graphical 名师资料总结-精品资料欢迎下载-名师精心整理-第 8 页,共 22 页 -9 output device supported by the computer on which MATLAB is running.This capability makes MATLAB an outstanding tool for

27、visualizing technical data.5.Graphical User Interface MATLAB includes tools that allow a programmer 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

28、inexperienced users.6.MATLAB Compiler MATLAB s flexib ility and platform independence is achieved 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.Unfor

29、tunately,the resulting programs can sometimes execute slowly because the MATLAB code is interpreted 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 tru

30、e executable that runs faster than the interpreted code.It is a great way to convert 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

31、can execute more slowly than compiled languages.This problem can be mitigated by properly 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 time

32、s more expensive than a conventional C or Fortran compiler.This relatively high 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 purch

33、asing.Fortunately,there is also an 名师资料总结-精品资料欢迎下载-名师精心整理-第 9 页,共 22 页 -10 inexpensive Student Edition of MATLAB,which 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

34、 programs are going to become more complex,and it will get easier to make mistakes.To help avoid programming errors,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.Intr

35、oduction To Top-Down Design Techniques Suppose that you are an engineer working in industry,and that you need 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 th

36、inking about the problem first.It is often possible to get away with this“on the fly”approach to programming 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.Fo

37、r larger problems,it pays to completely think out the problem and the approach you are going 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.F

38、or some of the simple examples that we will be doing,the design process will seem like overkill;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,“progr

39、amming is easy.It is knowing what to program that is hard.”his point was forcefully 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 real

40、ly understood the problem,it became easy to break the problem apart into smaller,more easily manageable pieces 名师资料总结-精品资料欢迎下载-名师精心整理-第 10 页,共 22 页 -11 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

41、it down into smaller,more easily understandable pieces,which perform a portion of the desired task.Each subtask may 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

42、 subtasks into a complete task until each of the subtasks has been verified to work properly by itself.The concept 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 s

43、tate the problem that you are trying to solve.Programs are usually written to fill some perceived need,but that 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 cle

44、ar enough to allow a programmer to design a program to meet the need;he or she must first know much more 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 t

45、he equations that might be exploited to make the task easier?The program designer will have to talk 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 misunderst

46、andings,and it will also help the program designer to properly organize his or her thoughts.In the example we were describing,a proper statement of the problem might have been:名师资料总结-精品资料欢迎下载-名师精心整理-第 11 页,共 22 页 -12 Figure 1 Design and write a program to solve a system of simultaneous linear equati

47、ons having real coefficients and with up to 20 equations in 20 unknowns.2.Define the inputs required by the program and the outputs to 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 ove

48、rall processing scheme.In this example,the coefficients of the equations to be solved are probably in some pre-existing order,and our 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 requ

49、ired by the programs that may follow it in the overall processing scheme,and to write out those answers in the format needed by the 名师资料总结-精品资料欢迎下载-名师精心整理-第 12 页,共 22 页 -13 programs following it.3.Design the algorithm that you intend to implement in the program.An algorithm is a step-by-step procedu

50、re 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 within the problem,and divides it up into subtasks along those lines.This process is called decomposition.If the subtasks are large,the

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

当前位置:首页 > 技术资料 > 技术总结

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁