matlab应用外文翻译讲课稿
matlab 专业英语翻译(原文)
MATLAB 的介绍什么是MA TLAB这个名字为MATLAB代表矩形组。
MATLAB代表最初是提供方便地访问矩形软件的LINPACK 和EISPACK项目。
现在,MA TLAB使用LINPACK 和EISPACK项目所开发的软件,它代表一起开发了先进的设备,使用在艺术的矩阵计算软件。
基于MATLAB已经发展了一个有许多用户很多年。
它是由MathWorks公司,如在图8 - 1.In大学环境所示,它是标准的在数学,工程和science.In行业的初级和高级课程的教学工具,MATLAB是高选择的工具生产力研究,开发和分析。
* The MathWorks公司提供的数据分析,可视化,应用开发,仿真,设计集成产品集,代码generation.MATLAB是所有MathWorks产品的基础MATLAB是一个直观的语言和技术计算环境。
随着用户超过500万个社区整个行业,政府和学术界的强大传播,MATLAB是公认的全球标准的技术运算。
MATLAB是用于各种应用领域,包括信号和图像处理,控制系统设计,地球科学和生命科学,金融和经济,仪器仪表等。
开放的架构可以很容易地使用MATLAB和配套产品,探索和创造,提供数据的早期探索和竞争advantages.Simulink定制工具是模拟和原型开发环境的建模,模拟和分析现实世界,动态系统。
Simulink环境提供了一个框图接口,在核心MATLAB的数字,图形和编程功能之上。
为什么用MA TLAB?依靠遍布全球的专业技术基于MATLAB加快他们的研究,压缩投资的分析和开发时间,降低工程成本,并产生有效的解决办法。
MATLAB环境鼓励创造性,使你能够快速测试和多种方案比较,结果。
你生产出更好的解决方案。
用户发现,MATLAB接口的直观,语言的组合,内置的数学和图形功能使MATLAB 的技术计算的首选平台比使用C,Fortran和其他语言和应用程序。
从MATLAB的数据采集处理和分析范围的工程和科学计算任务,到应用开发。
MATLAB英文材料-基于matlab的仿真(含中文翻译)
1. Introduction
Navigation is the essential ability that a mobile robot. During the development of new navigation algorithms, it is necessary to test them in simulated robots and environments before the testing on real robots and the real world. This is because (i) the prices of robots are expansive; (ii) the untested algorithm may damage the robot during the experiment; (iii) difficulties on the construction and alternation of system models under noise background; (iv) the transient state is difficult to track precisely; and (v) the measurements to the external beacons are hidden during the experiment, but this information is often helpful for debugging and updating the algorithms.
This paper presents a Matlab-based simulator that is fully compatible with Matlab codes,and makes it possible for robotics researchers to debug their codeand do experiments conveniently at the first stage of their research.The algorithms development is based on Matlab subroutines with appointed parameter variables,which are stored in a file to be accessed by the ing this simulator,we can build the environment, select parameters,build subroutinesand display outputs on the screen.Data are recorded during the whole procedure;some basic analyses are also performed.
外文翻译+原文
MATALAB 混合仿真平台控制算法的概述MATALB混合仿真平台,即为将硬件引入到仿真回路里的半实物仿真系统,可用于过程控制器的开发与测试。
平台提供了三种控制器的嵌入方法,尤其能用Matlab 语言编写,大大提高了平台的灵活性。
为了建立过程控制混合仿真试验系统,必须解决PC 机作为虚拟控制器设计环境的实现和在Windows 操作系统中实时控制的实现这两个问题。
我们先详细阐述过程控制混合仿真试验系统的实现原理;最后介绍平台控制算法的嵌入方法,并通过实验仿真验证平台的有效性。
过程控制混合仿真平台实现原理:(1)数值计算,MATLAB提供了大约600多个数学和工程上常用的函数。
这些函数的数值运算是针对矩阵操作优化过的,可以使用它来代替底层编程语言。
在保持同样性能的情况下,编程工作量非常小,数值计算采用了LAPACK,BLAS,FFTW等优秀数学函数库,使得计算效率得到进一步的提升。
MATLAB 包含的主要数学函数有线性代数和矩阵运算、傅立叶变换和统计分析、微分方程求解、稀疏矩阵运算以及三角和其他初等数学运算等;除此之外,随着Matlab的应用领域不断的扩大,补充了用于许多特定领域的函数。
(2)算法开发,强大的计算能力,方便易用的编程语言和丰富的数学函数使MATLAB最适于用于算法开发工作。
典型的应用包括:数据分析,信号处理,图像处理,系统建模和高级算法研究等。
不管用户是使用已有的算法,还是自行开发,MATLAB提供了一个通用的平台。
使用MATLAB进行算法开发就像平时书写数学表达式一样。
将用户在MATLAB 中开发的算法结合到外部运行的系统中。
一旦用户的算法和仿真经过了编写和调试,MATLAB Compiler和C/C++ Math Library 会将MATLAB应用自动转换成可移植C 和C++代码的工具。
对于信号处理,控制系统设计和其他一些应用,MATLAB工具箱提供了一系列先进的技术。
工具箱远远超出了提供一些基本算法的范畴:他们提供了一个学习,研究,创新前沿理论和技术的舞台。
matlab programing for engineers英文课件
Launch Pad
9
The Command Window
The command prompt(>>) π is predefined ,use pi Ellipsis(„),continu ing on the next line x1=1+1/2+1/3+1/4+1/5 +1/6; and x1=1+1/2+1/3+1/4„ +1/5+1/6;
4
Introduction to MATLAB
MATrix LABoratory
MATLAB array Advantages of MATLAB
Ease of use Platform independence Predefined functions Plotting
Type lookfor command
19
A Few Important Commands
Type demo or select “demos” in the Launch Pad clc clf Clear ^c(control-c), abort ! Invoke operating system command diary (diary fileneme,diary off ,diary on)
Use meaningful names for variables MATLAB variable names
Hale Waihona Puke must begin with a letter can contain any combination of letters, numbers and underscore (_) must be unique in the first 31 characters
外文翻译---MATLAB 在图像边缘检测中的应用
英文资料翻译MATLAB application in image edge detection MATLAB of the 1984 countries MathWorks company to market since, after 10 years of development, has become internationally recognized the best technology application software. MATLAB is not only a kind of direct, efficient computer language, and at the same time, a scientific computing platform, it for data analysis and data visualization, algorithm and application development to provide the most core of math and advanced graphics tools. According to provide it with the more than 500 math and engineering function, engineering and technical personnel and scientific workers can integrated environment of developing or programming to complete their calculation.MATLAB software has very strong openness and adapt to sex. Keep the kernel in under the condition of invariable, MATLAB is in view of the different application subject of launch corresponding Toolbox (Toolbox), has now launched image processing Toolbox, signal processing Toolbox, wavelet Toolbox, neural network Toolbox and communication tools box, etc multiple disciplines special kit, which would place of different subjects research work.MATLAB image processing kit is by a series of support image processing function from the composition, the support of the image processing operation: geometric operation area of operation and operation; Linear filter and filter design; Transform (DCT transform); Image analysis and strengthened; Binary image manipulation, etc. Image processing tool kit function, the function can be divided into the following categories: image display; Image file input and output; Geometric operation; Pixels statistics; Image analysis and strengthened; Image filtering; Sex 2 d filter design; Image transformation; Fields and piece of operation; Binary image operation; Color mapping and color space transformation; Image types and type conversion; Kit acquiring parameters and Settings.1.Edge detection thisUse computer image processing has two purposes: produce more suitable for human observation and identification of the images; Hope can by the automatic computer image recognition and understanding.No matter what kind of purpose to, image processing the key step is to contain a variety of scenery of decomposition of image information. Decomposition of the end result is that break down into some has some kind of characteristics of the smallest components, known as the image of the yuan. Relative to the whole image of speaking, this the yuan more easily to be rapid processing.Image characteristics is to point to the image can be used as the sign of the field properties, it can be divided into the statistical features of the image and image visual, two types of levy. The statistical features of the image is to point to some people the characteristics of definition, through the transform to get, such as image histogram, moments, spectrum, etc.; Image visual characteristics is refers to person visual sense can be directly by the natural features, such as the brightness of the area, and texture or outline, etc. The two kinds of characteristics of the image into a series of meaningful goal or regional p rocess called image segmentation.The image is the basic characteristics of edge, the edge is to show its pixel grayscale around a step change order or roof of the collection of those changes pixels. It exists in target and background, goals and objectives, regional and region, the yuan and the yuan between, therefore, it is the image segmentation dependent on the most important characteristic that the texture characteristics of important information sources and shape characteristics of the foundation, and the image of the texture characteristics and the extraction of shape often dependent on image segmentation. Image edge extraction is also the basis of image matching, because it is the sign of position, the change of the original is not sensitive, and can be used for matching the feature points.The edge of the image is reflected by gray not continuity. Classic edge extraction method is investigation of each pixel image in an area of the gray change, use edge first or second order nearby directional derivative change rule,with simple method of edge detection, this method called edge detection method of local operators.The type of edge can be divided into two types: (1) step representation sexual edge, it on both sides of the pixel gray value varies significantly different; (2) the roof edges, it is located in gray value from the change of increased to reduce the turning point. For order jump sexual edge, second order directional derivative in edge is zero cross; For the roof edges, second order directional derivative in edge take extreme value.If a pixel fell in the image a certain object boundary, then its field will become a gray level with the change. The most useful to change two features is the rate of change and the gray direction, they are in the range of the gradient vector and the direction to said. Edge detection operator check every pixel grayscale rate fields and evaluation, and also include to determine the directions of the most use based on directional derivative deconvolution method for masking.Digital image processing technique has been widely applied to the biomedical field, the use of computer image processing and analysis, and complete detection and recognition of cancer cells can help doctors make a diagnosis of tumor cancers. Need to be made in the identification of cancer cells, the quantitative results, the human eye is difficult to accurately complete such work, and the use of computer image processing to complete the analysis and identification of the microscopic images have made great progress. In recent years, domestic and foreign medical images of cancer cells testing to identify the researchers put forward a lot of theory and method for the diagnosis of cancer cells has very important meaning and practical value.Cell edge detection is the cell area of the number of roundness and color, shape and chromaticity calculation and the basis of the analysis their test results directly affect the analysis and diagnosis of the disease. Classical edge detection operators such as Sobel operator, Laplacian operator, each pixel neighborhood of the image gray scale changes to detect the edge. Although these operators is simple, fast, but there are sensitive to noise, get isolated or in short sections of acontinuous edge pixels, overlapping the adjacent cell edge defects, while the optimal threshold segmentation and contour extraction method of combining edge detection, obtained by the iterative algorithm for the optimal threshold for image segmentation, contour extraction algorithm, digging inside the cell pixels, the last remaining part of the image is the edge of the cell, change the processing order of the traditional edge detection algorithm, by MATLAB programming, the experimental results that can effectively suppress the noise impact at the same time be able to objectively and correctly select the edge detection threshold, precision cell edge detection.2.Edge detection of MATLABMATLAB image processing toolkit defines the edge () function is used to test the edge of gray image.(1) BW = edge (I, "method"), returns and I size binary image BW, includingelements of 1 said is on the edge of the point, 0 means the edge points.Method for the following a string of:1) soble: the default value, with derivative Sobel edge detectionapproximate measure, to return to a maximum gradient edge;2) prewitt: with the derivative prewitt approximate edge detection, amaximum gradient to return to edge;3) Roberts: with the derivative Roberts approximate edge detection margins,return to a maximum gradient edge;4) the log: use the Laplace operation gaussian filter to I carry filtering,through the looking for 0 intersecting detection of edge;5) zerocross: use the filter to designated I filter, looking for 0 intersectingdetection of edge.(2) BW = edge (I, "method", thresh) with thresh designated sensitivitythreshold value, rather than the edge of all not thresh are ignored.(3) BW = edge (I, "method" thresh, direction, for soble and prewitt methodspecified direction, direction for string, including horizontal level said direction; Vertical said to hang straight party; Both said the two directions(the default).(4) BW = edge (I, 'log', thresh, log sigma), with sigma specified standarddeviation.(5) [BW, thresh] = edge (...), the return value of a function in fact have multiple(" BW "and" thresh "), but because the brace up with u said as a matrix, and so can be thought a return only parameters, which also shows the introduction of the concept of matrix MATLAB unity and superiority.st wordMATLAB has strong image processing function, provide a simple function calls to realize many classic image processing method. Not only is the image edge detection, in transform domain processing, image enhancement, mathematics morphological processing, and other aspects of the study, MATLAB can greatly improve the efficiency rapidly in the study of new ideas.MATLAB 在图像边缘检测中的应用MATLAB自1984年由国MathWorks公司推向市场以来,历经十几年的发展,现已成为国际公认的最优秀的科技应用软件。
MATLAB英文手稿讲义References
References1. Wang Yonglong, Introduction and Applications in MATLAB (manuscript), 2007.2. Rudra Pratap. Getting Started with MATLAB 5: A Quick Introduction for Scientists and Engineers, 1999, Oxford University.3. Cheng Weiguo, Feng Feng, Wang Xuemei, and Liu Yi. Advanced Applications on MATLAB 5.3 Programming, China Machine Press, 2000.(程卫国,冯峰,王雪梅,刘艺,MATLAB 5.3 精要、编程及高级应用,2000,机械工业出版社.)4. Adrian Biran, Moshe Breiner. MATLAB 6 for Engineers, New York: Prentice Hall, 2002.5. Edward B. Magrab etal.. An Engineer’s Guide to MATLAB, Publishing House of Electronics Industry, 2002 (in Chinese).6. Delores M. Etter, David C. Kuncicky, Dug Hull. Introduction to MATLAB 6. 2nd ed., NJ: Pearson Education Inc, 2004.7. Help Contents of MATLAB 7.1.8. Liu Weiguo. MATLAB Program and Application (Second Edition), Higher Education Press, 2006. (in Chinese)(刘卫国主编. MATLAB程序设计与应用(第二版),高等教育出版社,2006.)9. . MATLAB Application, Publishing House of Electronics Industry, 2005. (in Chinese)(飞思科技产品研发中心编著. MATLAB7 基础与提高,电子工业出版社,2005.)10. John H. Mathews, and Kurtis D. Fink. Numerical Methods Using MATLAB (4th Edition), Publishing House of Electronics Industry, 2005.11. Stephen J. Chapman. MATLAB Programming for Engineers (Second Edition), Science Press (Beijing), 2005.12. Peng Fanglin. Solutions and Visualizations of Mathematical Physical Equations in MATLAB, Tsing Hua University Press, 2004 (in Chinese).(彭芳麟. 数学物理方程的MATLAB解法与可视化,清华大学出版社,2004.)13. Help Contents of MATLAB 7.1.14. Qiu Guanyuan. Electrocircuits, Higher Education Press, 2004. (in Chinese)(邱关源,电路,高等教育出版社,2004.)15. Chen Xiaoping, Li Changjie. MATLAB and Applications in Electrocircuits and Automatic Control, University of Science and Technology of China Press, 2004(in Chinese).(陈晓平,李长杰,MATLAB及其在电路与控制理论中的应用,中国科学技术大学出版社,2004.)16 Richard Feynman. Lectures on Physics, World Publishing Company, 2005.17. Zhong Jikang, Bao Hongji. Computer Solutions to the Problems of College Physics, Applications of MATLAB Programming, China Machine Press, 2007.(in Chinese)(钟季康,鲍鸿吉. 大学物理习题计算机解法,MATLAB编程应用,机械工业出版社,2007.)233。
matlab图像处理外文翻译外文文献
matlab图像处理外文翻译外文文献附录A 英文原文Scene recognition for mine rescue robotlocalization based on visionCUI Yi-an(崔益安), CAI Zi-xing(蔡自兴), WANG Lu(王璐)Abstract:A new scene recognition system was presented based on fuzzy logic and hidden Markov model(HMM) that can be applied in mine rescue robot localization during emergencies. The system uses monocular camera to acquire omni-directional images of the mine environment where the robot locates. By adopting center-surround difference method, the salient local image regions are extracted from the images as natural landmarks. These landmarks are organized by using HMM to represent the scene where the robot is, and fuzzy logic strategy is used to match the scene and landmark. By this way, the localization problem, which is the scene recognition problem in the system, can be converted into the evaluation problem of HMM. The contributions of these skills make the system have the ability to deal with changes in scale, 2D rotation and viewpoint. The results of experiments also prove that the system has higher ratio of recognition and localization in both static and dynamic mine environments.Key words: robot location; scene recognition; salient image; matching strategy; fuzzy logic; hidden Markov model1 IntroductionSearch and rescue in disaster area in the domain of robot is a burgeoning and challenging subject[1]. Mine rescue robot was developed to enter mines during emergencies to locate possible escape routes for those trapped inside and determine whether it is safe for human to enter or not. Localization is a fundamental problem in this field. Localization methods based on camera can be mainly classified into geometric, topological or hybrid ones[2]. With its feasibility and effectiveness, scene recognition becomes one of the important technologies of topological localization.Currently most scene recognition methods are based on global image features and have two distinct stages: training offline and matching online.。
matlab应用外文翻译
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 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. This 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 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 available.Advantages of MATLABMATLAB has many advantages compared 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 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 thelanguage is so easy to use, it is ideal for educational use, and for the rapid prototyping of new programs.Many program development tools are provided to make the program easy to use. a workspace browser, and extensive demos.2.Platform independenceMATLAB is supported on many different computer systems, providinga 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 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 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 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 hundreds 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 standard 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 freeuser-contributed MATLAB programs that are shared through the MATLAB Web site.4.Device-Independent PlottingUnlike most other computer languages, MATLAB has many integral plotting 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 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 inexperienced users. 6.MATLAB CompilerMATLAB′s flexibility 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.Unfortunately, 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 compilea MATLAB program into a true executable that runs faster than theinterpreted code. It is a great way to convert a prototype MATLAB program into an executable suitable for sale and distribution to users. Disadvantages of MATLABMATLAB 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 properly structuring theMATLAB 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 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, 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 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.Introduction To Top-Down Design TechniquesSuppose 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 thinking 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. For 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 thenapply 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 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, “programming 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 really understood the problem, it became easy to break the problem apart into smaller, 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 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 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 state 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 clear enough to allow a programmer to design a program to meet the need; he or she must first know much moreabout 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 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 the 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 linearequations 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 producedby 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 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 required by the programs that may follow it in the overall processing scheme, and to write out those answers in the format needed by 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 within 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 simple, 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 functions 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 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 process 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 tested 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 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 through 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 program 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 combinations ofthe 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 2MATLAB 介绍MATLAB (矩阵实验室的简称)是一种专业的计算机程序,用于工程科学的矩阵数学运算。
第1讲Matlab语言及其应用 课件
2019/3/11
Application of Matlab Language
4
2.1 启动与退出MATLAB
? 启动MATLAB
? 直接用鼠标双击桌面上MATLAB图标 ? 或Windows桌面的“开始”—〉“所有程
序”—〉“MATLAB” —〉“MATLAB”。
? 退出MATLAB
? 关闭MATLAB桌面 ? 在命令窗口执行quit或exit命令
y= 0.5000
【例2.2-5 】计算 y ? 2cos ?的0.3?值?。
1? 5
>>y=2*cos(0.3*pi)/(1+sqrt(令行编辑 ? “↑”键调回已 输入过命令。
? 修改。
2019/3/11
Application of Matlab Language
10
6
2.2 命令窗口的使用
? 激活命令窗口。 ? “>>” 与闪烁的光标一起表明系统就绪,等待输入。 ? 命令窗口脱离 MATLAB桌面。
? 简单计算
【例2.2-1 】计算 ??12 ??2 ?7 ? 4??? ? 32
(1)在MATLAB 命令窗口输入 以下内容:
>>(12+2*(7-4))/3^2 (2)按【 Enter 】键,指令执行。 (3)返回的计算结果: ans=
2
2019/3/11
Application of Matlab Language
7
2.2 命令窗口 (续)
〖说明〗
? 在命令窗口【Enter】键提交命令执行。 ? Matlab所用运算符(如+、-、^等)是各种计算程序中
常见的。 ? 计算结果中的“ans”是英文“answer”的一种缩写,
MATLAB在_数字信号处理_双语教学中的应用
本栏目责任编辑:王力计算机教育1引言“数字信号处理”是电子信息工程专业的核心课程之一,随着科学技术的迅速发展,信号处理技术已成为我国实施以信息化带动工业化战略的桥梁。
目前国内外许多高校都开设此课,也有可供选择的国外优秀教材,这为在数字信号处理课程中进行双语教学提供了理论教学的方便,但数字信号处理是一门理论性和实践性都很强的课程,其特点为概念抽象,数学计算量大,并且涉及大量的矩阵计算和公式推导,计算复杂,再加上采用的英文教材,势必使学生难以理解,使教学质量大打折扣。
MATLAB提供了一个人机交互的数学系统环境,特别是提供了数字信号处理工具箱,可以很方便地进行数字信号处理方面的有关运算和系统设计及仿真,这就可以解决学生理论与实践脱节的矛盾,同时将教学内容中难以理解的抽象概念、公式和例题中的结果用图形的方法直观地表示出来,便于形象地理解教学内容;在欧美等高等院校的理工科专业已经将MATLAB列为大学生、研究生、博士生必须掌握的基本技能,将其作为工科学生的必修课程,研究设计开发单位也将MATLAB作为解决具体工程问题的软件标准,并且MATLAB软件只有英文版本,因此为了培养与国际接轨的专业人才,在我国高校的工科专业课中,应用MATLAB是双语教学改革采取的必然措施。
我校对“数字信号处理”课程进行英汉双语教学试验,选用文字浅显,难度适中,讲解较全面清晰且例题与习题要求MATLAB编程的英文影印版教材[1],考虑到学生的接受能力,讲授语言中英文相结合,基本保持在英文30-40%、中文60-70%的份量,但板书(在此为多媒体教学系统上的电子板书)与作业为纯英文,笔者有幸承担了100多名电子信息专业三年级本科生的“数字信号处理”课程的双语多媒体教学工作,以下就MATLAB在“数字信号处理”双语教学中的应用进行探讨,并给出了应用实例。
2MATLAB在双语理论教学中的应用利用Matlab的ActiveX技术将Matlab作为后台服务器,客户是PowerPoint,由此制作的电子教案可以实时地执行Matlab命令,并可与Matlab的工作空间交换数据,让学生感受到现场进行复杂科学计算或改变参数后进行实时计算,并给出数字和图形结果的效果,生动地传递教师的思想,并能与学生实现互动,使学生从Matlab的强大功能演示中自觉产生学习英语的动力和兴趣,深刻体会到如果没有一定的专业词汇,将大大的妨碍纯英文软件的理解和应用,无法完成“数字信号处理”课程的学习。
Matlab简明英文教程
Matlab简明英文教程(1)收藏到手机转发评论2008-03-01 23:18MATLAB (matrix algebra)Matlab is a commercial "Matrix Laboratory" package which operates as an interactive programming environment. It is a mainstay of the Mathematics Department software lineup and is also available for PC's and Macintoshes and may be found on the CIRCA VAXes. Matlab is well adapted to numerical experiments since the underlying algorithms for Matlab's builtin functions and supplied m-files are based on the standard libraries LINPACK and EISPACK.Matlab program and script files always have filenames ending with ".m"; the programming language is exceptionally straightforward since almost every data object is assumed to be an array. Graphical output is available to supplement numerical results.Online help is available from the Matlab prompt (a double arrow), both generally (listing all available commands):[a long list of help topics follows]and for specific commands:>> help fft[a help message on the fft function follows].Paper documentation is on the document shelf in compact black books and locally generated tutorials are available and are used in courses.How to quit MatlabThe answer to the most popular question concerning any program is this: leave a Matlab session by typingquitor by typingexitto the Matlab prompt.Batch jobsMatlab is most often used interactively, but "batch" or "background" jobs can be performed as well. Debug your commands interactively and store them in a file (`script.m', for example). To start a background session from your input file and to put the output and error messages into another file (`script.out', for example), enter this line at the system prompt:nice matlab < script.m >& script.out &You can then do other work at the machine or logout while Matlab grinds out your program. Here's an explanation of the sequence of commands above.The "nice" command lowers matlab's priority so that interactive users have first crack at the CPU. You must do this for noninteractive Matlab sessions because of the load that number--crunching puts on the CPU.The "< script.m" means that input is to be read from the file script.m.The ">& script.out" is an instruction to send program output and error output to the file script.out. (It is important to include the first ampersand (&) so that error messages are sent to your file rather than to the screen -- if you omit the ampersand then your error messages may turn up on other people's screens and your popularity will plummet.)Finally, the concluding ampersand (&) puts the whole job into background.(Of course, the file names used above are not important -- these are just examples to illustrate the format of the command string.)A quick tutorial on Matlab is available in the next Info node in this file. (Touch the "n" key to go there now, or return to the menu in the Top node for this file.)MATLAB TutorialMATLAB Tutorial (based on work of R. Smith, November 1988 and later)This is an interactive introduction to MATLAB. I have provided a sequence of commands for you to type in. The designation RET means that you should type the "return" key; this is implicit after a command.To bring up MATLAB from from the operating system promptlab%you should type matlablab% matlab RETThis will present the prompt>>You are now in MATLAB.If you are using the X Window system on the Mathematics Department workstations then you can also start MATLAB from the Main Menu by selecting "matlab" from the "Math Applications" submenu. A window should pop up and start MATLAB. When you run MATLAB under the window system, whether you start from the menu or a system prompt, a small MATLAB logo window will pop up while the program is loading and disappear when MATLAB is ready to use.When you are ready to leave, type exit>> exit RETIn the course of the tutorial if you get stuck on what a command means type>> help <command name> RETand then try the command again.You should record the outcome of the commands and experiments in a notebook.Remark: Depending on the Info reader you are using to navigate this tutorial, you might be able to cut and paste many of the examples directly into Matlab.Building MatricesMatlab has many types of matrices which are built into the system. A 7 by 7 matrix with random entries is produced by typingrand(7)You can generate random matrices of other sizes and get help on the rand command within matlab:rand(2,5)help randAnother special matrix, called a Hilbert matrix, is a standard example in numerical linear algebra. hilb(5)help hilbA 5 by 5 magic square is given by the next command:magic(5)help magicA magic square is a square matrix which has equal sums along all its rows and columns. We'll use matrix multiplication to check this property a bit later.Some of the standard matrices from linear algebra are easily produced:eye(6)zeros(4,7)ones(5)You can also build matrices of your own with any entries that you may want.[1 2 3 5 7 9][1, 2, 3; 4, 5, 6; 7, 8, 9][1 2 RET 3 4 RET 5 6][Note that if you are using cut-and-paste features of a window system or editor to copy these examples into Matlab then you should not use cut-and-paste and the last line above. Type it in by hand, touching the Return or Enter key where you see RET, and check to see whether the carriage returns make any difference in Matlab's output.]Matlab syntax is convenient for blocked matrices:[eye(2);zeros(2)][eye(2);zeros(3)][eye(2),ones(2,3)]Did any of the last three examples produce error messages? What is the problem?VariablesMatlab has built-in variables like pi, eps, and ans. You can learn their values from the Matlab interpreter.piepshelp epsAt any time you want to know the active variables you can use who:whohelp whoThe variable ans will keep track of the last output which was not assigned to another variable. magic(6)x = ansx = [x, eye(6)]xSince you have created a new variable, x, it should appear as an active variable.whoTo remove a variable, try this:clear xxwhoFunctionsa = magic(4)Take the transpose of a:a'Note that if the matrix A has complex numbers as entries then the Matlab function taking A to A' will compute the transpose of the conjugate of A rather than the transpose of A.Other arithmetic operations are easy to perform.3*a-aa+(-a)b = max(a)max(b)Some Matlab functions can return more than one value. In the case of max the interpreter returns the maximum value and also the column index where the maximum value occurs. [m, i] = max(b)min(a)b = 2*ones(a)a*baWe can use matrix multiplication to check the "magic" property of magic squares.A = magic(5)b = ones(5,1)A*bv = ones(1,5)v*AMatlab has a convention in which a dot in front of an operation usually changes the operation. In the case of multiplication, a.*b will perform entry-by-entry multiplication instead of the usual matrix multiplication.a.*b (there is a dot there!)x = 5x^2a*aa^2a.^2 (another dot)atriu(a)tril(a)diag(a)diag(diag(a))c=rand(4,5)size(c)[m,n] = size(c)md=.5-cThere are many functions which we apply to scalars which Matlab can apply to both scalars and matrices.sin(d)exp(d)log(d)abs(d)Matlab has functions to round floating point numbers to integers. These are round, fix, ceil, and floor. The next few examples work through this set of commands and a couple more arithmetic operations.f=[-.5 .1 .5]round(f)fix(f)ceil(f)floor(f)sum(f)prod(f)Relations and Logical OperationsIn this section you should think of 1 as "true" and 0 as "false." The notations &, |, ~ stand for "and,""or," and "not," respectively. The notation == is a check for equality.a=[1 0 1 0]b=[1 1 0 0]a==ba<=b~aa&ba & ~aa | ba | ~aThere is a function to determine if a matrix has at least one nonzero entry, any, as well as a function to determine if all the entries are nonzero, all.aany(a)c=zeros(1,4)d=ones(1,4)any(c)all(a)all(d)e=[a',b',c',d']any(e)all(e)any(all(e))Colon NotationMatlab offers some powerful methods for creating arrays and for taking them apart.x=-2:1length(x)-2:.5:1-2:.2:1a=magic(5)a(2,3)Now we will use the colon notation to select a column of a.a(2,:)a(:,3)aa(2:4,:)a(:,3:5)a(2:4,3:5)a(1:2:5,:)You can put a vector into a row or column position within a.a(:,[1 2 5])a([2 5],[2 4 5])You can also make assignment statements using a vector or a matrix.b=rand(5)b([1 2],:)=a([1 2],:)a(:,[1 2])=b(:,[3 5])a(:,[1 5])=a(:,[5 1])a=a(:,5:-1:1)When you a insert a 0-1 vector into the column position then the columns which correspond to 1's are displayed.v=[0 1 0 1 1]a(:,v)a(v,:)This has been a sample of the basic MATLAB functions and the matrix manipulation techniques. At the end of the tutorial there is a listing of functions. The functions that you have available will vary slightly from version to version of MATLAB. By typinghelpyou will get access to descriptions of all the Matlab functions.Miscellaneous FeaturesYou may have discovered by now that MATLAB is case sensitive, that is"a" is not the same as "A."If this proves to be an annoyance, the commandcasesenwill toggle the case sensitivity off and on.The MATLAB display only shows 5 digits in the default mode. The fact is that MATLAB always keeps and computes in a double precision 16 decimal places and rounds the display to 4 digits. The commandformat longwill switch to display all 16 digits andformat shortwill return to the shorter display. It is also possible to toggle back and forth in the scientific notation display with the commandsformat short eandformat long eIt is not always necessary for MATLAB to display the results of a command to the screen. If you do not want the matrix A displayed, put a semicolon after it, A;. When MATLAB is ready to proceed, the prompt >> will appear. Try this on a matrix right now.Sometimes you will have spent much time creating matrices in the course of your MATLAB session and you would like to use these same matrices in your next session. You can save these values in a file by typingsave filenameThis creates a filefilename.matwhich contains the values of the variables from your session. If you do not want to save all variables there are two options. One is to clear the variables off with the commandclear a b cwhich will remove the variables a,b,c. The other option is to use the commandsave x y zwhich will save the variables x,y,z in the file filename.mat. The variables can be reloaded in a future session by typingload filenameWhen you are ready to print out the results of a session, you can store the results in a file and print the file from the operating system using the "print" command appropriate for your operating system. The file is created using the commanddiary filenameOnce a file name has been established you can toggle the diary with the commandsdiary onanddiary offThis will copy anything which goes to the screen (other than graphics) to the specified file. Since this is an ordinary ASCII file, you can edit it later. Discussion of print out for graphics is deferred to the project "Graphics" where MATLAB's graphics commands are presented.Some of you may be fortunate enough to be using a Macintosh or a Sun computer with a window system that allows you to quickly move in and out of MATLAB for editing, printing, or other processes at the system level. For those of you who are not so fortunate, MATLAB has a feature which allows you to do some of these tasks directly from MATLAB. Let us suppose that you wouldlike to edit a file named myfile.m and that your editor executes on the command ed. The MATLAB command!ed myfile.mwill bring up your editor and you can now work in it as you usually would. Obviously the exclamation point is the critical feature here. When you are done editing, exit your editor as you usually would, and you will find that you are back in your MATLAB session. You can use the ! with many operating system commands.Programming in MATLABMATLAB is also a programming language. By creating a file with the extension .m you can easily write and run programs. If you were to create a program file myfile.m in the MATLAB language, then you can make the command myfile from MATLAB and it will run like any other MATLAB function. You do not need to compile the program since MATLAB is an interpretative (not compiled) language. Such a file is called an m-file.I am going to describe the basic programming constructions. While there are other constructions available, if you master these you will be able to write clear programs.AssignmentAssignment is the method of giving a value to a variable. You have already seen this in the interactive mode. We write x=a to give the value of a to the value of x. Here is a short program illustrating the use of assignment.function r=mod(a,d)% r=mod(a,d). If a and d are integers, then% r is the integer remainder of a after% division by d. If a and b are integer matrices,% then r is the matrix of remainders after division% by corresponding entries. Compare with REM.r=a-d.*floor(a./d);You should make a file named mod.m and enter this program exactly as it is written. Now assign some integer values for a and d. Runmod(a,d)This should run just like any built-in MATLAB function. Typehelp modThis should produce the five lines of comments which follow the % signs. The % signs generally indicate that what follows on that line is a comment which will be ignored when the program is being executed. MATLAB will print to the screen the comments which follow the "function" declaration at the top of the file when the help command is used. In this way you can contribute to the help facility provided by MATLAB to quickly determine the behavior of the function. Type type modThis will list out the entire file for your perusal. What does this line program mean? The first line is the "function declaration." In it the name of the function (which is always the same as the name of the file without the extension .m), the input variables (in this case a and d), and the output variables (in this case r) are declared. Next come the "help comments" which we have already discussed. Finally, we come to the meat of the program.The variable r is being assigned the value of a-d.*floor(a./d); The operations on the right hand side of the assignment have the meaning which you have just been practicing (the / is division) with the "." meaning the entry-wise operation as opposed to a matrix operation. Finally, the ";" prevents printing the answer to the screen before the end of execution. You might try replacing the ";" with a "," and running the program again just to see the difference.BranchingBranching is the constructionif <condition>, <program> endThe condition is a MATLAB function usually, but not necessarily with values 0 or 1 (later I will discuss when we can vary from this requirement), and the entire construction allows the execution of the program just in case the value of condition is not 0. If that value is 0, the control moves on to the next program construction. You should keep in mind that MATLAB regards a==b and a<=b as functions with values 0 or 1.Frequently, this construction is elaborated withif <condition1>, <program1> else <program2> endIn this case if condition is 0, then program2 is executed.Another variation isif <condition1>, <program1>elseif <condition2>, <program2>endNow if condition1 is not 0, then program1 is executed, if condition1 is 0 and if condition2 is not 0, then program2 is executed, and otherwise control is passed on to the next construction. Here is a short program to illustrate branching.function b=even(n)% b=even(n). If n is an even integer, then b=1% otherwise, b=0.if mod(n,2)==0,b=1;else b=0;endFor LoopsA for loop is a construction of the formfor i=1:n, <program>, endHere we will repeat program once for each index value i. Here are some sample programs. The first is matrix addition.function c=add(a,b)% c=add(a,b). This is the function which adds% the matrices a and b. It duplicates the MATLAB% function a+b.[m,n]=size(a);[k,l]=size(b);if m~=k | n~=l,r='ERROR using add: matrices are not the same size';return,endc=zeros(m,n);for i=1:m,for j=1:n,c(i,j)=a(i,j)+b(i,j);endendThe next program is matrix multiplication.function c=mult(a,b)% c=mult(a,b). This is the matrix product of% the matrices a and b. It duplicates the MATLAB% function c=a*b.[m,n]=size(a);[k,l]=size(b);if n~=k,c='ERROR using mult: matrices are not compatiblefor multiplication',return,end,c=zeros(m,l);for i=1:m,for j=1:l,for p=1:n,c(i,j)=c(i,j)+a(i,p)*b(p,j);endendendFor both of these programs you should notice the branch construction which follows the size statements. This is included as an error message. In the case of add, an error is made if we attempt to add matrices of different sizes, and in the case of mult it is an error to multiply if the matrix on the left does not have the same number of columns as the number of rows of the the matrix on the right. Had these messages not been included and the error was made, MATLAB would have delivered another error message saying that the index exceeds the matrix dimensions. You will notice in the error message the use of single quotes. The words surrounded by the quotes will be treated as text and sent to the screen as the value of the variable c. Following the message is the command return, which is the directive to send the control back to the function which called add or return to the prompt. I usually only recommend using the return command in the context of an error message. Most MATLAB implementations have an errormessage function, either errmsg or error, which you might prefer to use.In the constructionfor i=1:n, <program>, endthe index i may (in fact usually does) occur in some essential way inside the program. MATLAB will allow you to put any vector in place of the vector 1:n in this construction.Thus the constructionfor i=[2,4,5,6,10], <program>, endis perfectly legitimate. In this case program will execute 5 times and the values for the variable i during execution are successively, 2,4,5,6,10. The MATLAB developers went one step further. If you can put a vector in, why not put a matrix in? So, for example,for i=magic(7), <program>, endis also legal. Now the program will execute 7 (=number of columns) times, and the values of i used in program will be successively the columns of magic(7).While LoopsA while loop is a construction of the formwhile <condition>, <program>, endwhere condition is a MATLAB function, as with the branching construction. The program program will execute successively as long as the value of condition is not 0. While loops carry an implicit danger in that there is no guarantee in general that you will exit a while loop. Here is a sample program using a while loop.function l=twolog(n)% l=twolog(n). l is the floor of the base 2% logarithm of n.l=0;m=2;while m<=nl=l+1;m=2*m;endRecursionRecursion is a devious construction which allows a function to call itself. Here is a simple example of recursionfunction y=twoexp(n)% y=twoexp(n). This is a recursive program for computing% y=2^n. The program halts only if n is a nonnegative integer.if n==0, y=1;else y=2*twoexp(n-1);endThe program has a branching construction built in. Many recursive programs do. The condition n==0 is the base of the recursion. This is the only way to get the program to stop calling itself. The"else" part is the recursion. Notice how the twoexp(n-1) occurs right there in the program which is defining twoexp(n)! The secret is that it is calling a lower value, n-1, and it will continue to do so until it gets down to n=0. A successful recursion is calling a lower value.There are several dangers using recursion. The first is that, like while loops, it is possible for the function to call itself forever and never return an answer. The second is that recursion can lead to redundant calculations which, though they may terminate, can be time consuming. The third danger is that while a recursive program is running it needs extra space to accomodate the overhead of the recursion. In numerical calculations on very large systems of equations memory space is frequently at a premium, and it should not be wasted on program overhead. With all of these bad possibilities why use recursion? It is not always bad; only in the hands of an inexperienced user. Recursive programs can be easier to write and read than nonrecursive programs. Some of the future projects illustrate good and poor uses of recursion. Miscellaneous Programming ItemsIt is possible to place a matrix valued function as the condition of a branching construction or a while loop. Thus the condition might be a matrix like ones(2),zeros(2), or eye(2). How would a construction likeif <condition>, < program1>,else <program2>, endbehave if condition=eye(2)? The program1 will execute if all of the entries of condition are not 0. Thus if condition=magic(2), program1 will execute while if condition=eye(2) control will pass to the "else" part and program2 will execute.A problematic construction occurs when you haveif A ~= B, <program>, end.You would like program to execute if the matrices A and B differ on some entry. Under the convention, program will only execute when they differ on all entries. There are various ways around this. One is the constructionif A ==B else <program>, endwhich will pass control to the "else" part if A and B differ on at least one entry. Another is to convert A==B into a binary valued function by using all(all(A==B)). The inside all creates a binary vector whose i--th entry is 1 only if the i--th column of A is the same as the i--th column of B. The outside all produces a 1 if all the entries of the vector are 1. Thus if A and B differ on at least one entry, then all(all(A==B))=0. The constructionif ~ all(all(A==B)), <program>, endthen behaves in the desired way.Essentially, the same convention holds for the while construction.while <condition>, <program>, end.The program program will execute successively as long as every entry in condition is not 0, and the control passes out of the loop when at least one entry of condition is 0.Another problem occurs when you have a conjunction of conditions, as inif <condition1>&< condition2>,<program>, endOf course, program will execute if both condition1 and condition2 are nonzero. Suppose that condition1=0 and condition2 causes an error message. This might happen fori<=m & A(i,j)==0where m is the number of columns of A. If i>m, then you would like to pass the control, but since A(i,j) makes no sense if i>m an error message will be dished up. Here you can nest the conditions. if i<=m,if A(i,j)==0,<program>endendScriptsA script is an m-file without the function declaration at the top. A script behaves differently. When you type who you are given a list of the variables which are in force during the current session. Suppose that x is one of those variables. When you write a program using a function file and you use the variable x inside the program, the program will not use the value of x from your session (unless x was one of the input values in the function), rather x will have the value appropriate to the program. Furthermore, unless you declare a new value for x, the program will not change the value of x from the session. This is very convenient since it means that you do not have to worry too much about the session variables while your program is running. All this has happened because of the function declaration. If you do not make that function declaration, then the variables in your session can be altered. Sometimes this is quite useful, but I usually recommend that you use function files.SuggestionsThese are a few pointers about programming and programming in MATLAB in particular.1) I urge you to use the indented style that you have seen in the above programs. It makes the programs easier to read, the program syntax is easier to check, and it forces you to think in terms of building your programs in blocks.2) Put lots of comments in your program to tell the reader in plain English what is going on. Some day that reader will be you, and you will wonder what you did.3) Put error messages in your programs like the ones above. As you go through this manual, your programs will build on each other. Error messages will help you debug future programs.4) Always structure your output as if it will be the input of another function. For example, if your program has "yes-no" type output, do not have it return the words "yes" and "no," rather return 1 or 0, so that it can be used as a condition for a branch or while loop construction in the future.5) In MATLAB, try to avoid loops in your programs. MATLAB is optimized to run the built-in functions. For a comparison, see how much faster A*B is over mult(A,B). You will be amazed at how much economy can be achieved with MATLAB functions.6) If you are having trouble writing a program, get a small part of it running and try to build on that. With reference to 5), write the program first with loops, if necessary, then go back and improve it.。
MATLAB的中英文翻译
MATLAB - The Language Of Technical ComputingMATLAB is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages such as C, C++, and Fortran. You can use MATLAB in a wide range of applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. Add-on toolboxes (collections of special-purpose MATLAB functions, available separately) extend the MATLAB environment to solve particular classes of problems in these application areas.MATLAB provides a number of features for documenting and sharing your work. You can integrate your MATLAB code with other languages and applications, and distribute your MATLAB algorithms and applications.MATLAB has key featuers as follows:(1)High-level language for technical computing (2)Development environment for managing code, files, and data (3)Interactive tools for iterative exploration, design, and problem solving 4)Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, and numerical integration (5)2-D and 3-D graphics functions for visualizing data (6)Tools for building custom graphical user interfaces (7) Functions for integrating MATLAB based algorithms with external applications and languages, such as C, C++, Fortran, Java, COM, and Microsoft ExcelThe MATLAB language supports the vector and matrix operations that are fundamental to engineering and scientific problems. It enables fast development and execution. With the MATLAB language, you can program and develop algorithms faster than with traditional languages because you do not need to perform low-level administrative tasks, such as declaring variables, specifying data types, and allocating memory. In many cases, MATLAB eliminates the need for ‘for’ loops. As a result, one line of MATLAB code can often replace several lines of C or C++ code. At the same time, MATLAB provides all the features of a traditional programming language, including arithmetic operators, flow control, data structures, data types, object-oriented programming (OOP), and debugging features. MATLAB lets you execute commands or groups of commands one at a time, without compiling and linking, enabling you to quickly iterate to the optimal solution. For fast execution of heavy matrix and vector computations, MATLAB uses processor-optimized libraries. For general-purpose scalar computations, MATLAB generates machine-code instructions using its JIT (Just-In-Time) compilation technology. This technology, which is available on most platforms, provides execution speeds that rival those of traditional programming languages. MATLAB includes development tools that help you implement your algorithm efficiently. These include the following: MATLAB Editor - Provides standard editing and debugging features, such as setting breakpoints and single stepping. M-Lint Code Checker - Analyzes your code and recommends changes to improve its performance and maintainability. MATLAB Profiler - Records the time spentexecuting each line of code. Directory Reports- Scan all the files in a directory and report on code efficiency, file differences, file dependencies, and code coverage。
课程名称MATLAB语言及其应用
课程名称:MATLAB语言及其应用课程编号:7002801课程学分:2课程学时:32学时适用专业:机械设计制造及其自动化,材料成形及控制《MATLAB语言及其应用(双语)》MATLAB Programming & Application (bilingual)一、课程性质与目的本课程是本科四年制机械设计制造及其自动化专业的一门专业选修课。
本课程是解决各种复杂的科学计算问题的理论与技术基础。
它讨论用于科学计算中的一些最基本、最常用的算法,不但具有数学的抽象性与严密科学性,而且具有高度的应用性。
通过本课程的学习,学生可以获得一种从专业问题中抽象出数学模型进而运用MATLAB语言与环境去求解的思维方法;使学生能利用MATLAB熟练进行常用数值计算、简单编程、简单的数据处理及基本图形绘制等;训练综合运用语言和专业知识去解决学习或工作中的数学建模、数值计算、数据处理等问题,为毕业设计以及毕业后的研究和工程应用工作打下坚实的基础。
具体而言,本课程的目的是培养学生具备以下能力:1.MATLAB基本操作和编程能力;对应专业认证毕业要求中的【1】【2】【3】【4】【5】2. 利用MATLAB将工程问题进行数学建模和可视化表达的能力;对应专业认证的毕业要求中的【1】【2】【3】【4】【5】3.运用MATLAB对线性和非线性方程求解的能力;对应专业认证的毕业要求中的【1】【2】【3】【4】【5】4. 利用MATLAB解决一般性数据拟合与插值问题的能力;对应专业认证的毕业要求中的【1】【2】【3】【4】【5】5.利用MATLAB求解数值积分与微分问题的能力;对应专业认证的毕业要求中的【1】【2】【3】【4】【5】6. 利用数值法求解微分方程的能力;对应专业认证的毕业要求中的【1】【2】【3】【4】【5】7. 与合作者一起,综合运用文献检索、数学建模、数据可视化、数值计算、数据处理、解读计算结果、沟通交流等知识和能力,各负其责,解决各种实际工程问题的能力。
matlab中英文翻译文献讲课稿
附录英文原文Scene recognition for mine rescue robotlocalization based on visionAbstract:A new scene recognition system was presented based on fuzzy logic and hidden Markov model(HMM) that can be applied in mine rescue robot localization during emergencies. The system uses monocular camera to acquire omni-directional images of the mine environment where the robot locates. By adopting center-surround difference method, the salient local image regions are extracted from the images as natural landmarks. These landmarks are organized by using HMM to represent the scene where the robot is, and fuzzy logic strategy is used to match the scene and landmark. By this way, the localization problem, which is the scene recognition problem in the system, can be converted into the evaluation problem of HMM. The contributions of these skills make the system have the ability to deal with changes in scale, 2D rotation and viewpoint. The results of experiments also prove that the system has higher ratio of recognition and localization in both static and dynamic mine environments.Key words: robot location; scene recognition; salient image; matching strategy; fuzzy logic; hidden Markov model1 IntroductionSearch and rescue in disaster area in the domain of robot is a burgeoning and challenging subject[1]. Mine rescue robot was developed to enter mines during emergencies to locate possible escape routes for those trapped inside and determine whether it is safe for human to enter or not. Localization is a fundamental problem in this field. Localization methods based on camera can be mainly classified into geometric, topological or hybrid ones[2]. With its feasibility and effectiveness, scene recognition becomes one of the important technologies of topological localization.Currently most scene recognition methods are based on global image features and have two distinct stages: training offline and matching online.During the training stage, robot collects the images of the environment where it works and processes the images to extract global features that represent the scene. Some approaches were used to analyze the data-set of image directly and some primary features were found, such as the PCA method [3]. However, the PCA method is not effective in distinguishing the classes of features. Another type of approach uses appearance features including color, texture and edge density to represent the image. For example, ZHOU et al[4] used multidimensional histograms to describe global appearance features. This method is simple but sensitive to scale and illumination changes. In fact, all kinds of global image features are suffered from the change of environment.LOWE [5] presented a SIFT method that uses similarity invariant descriptors formed by characteristic scale and orientation at interest points to obtain the features. The features are invariant to image scaling, translation, rotation and partially invariant to illumination changes. But SIFT may generate 1 000 or more interest points, which may slow down the processor dramatically.During the matching stage, nearest neighbor strategy(NN) is widely adopted for its facility and intelligibility[6]. But it cannot capture the contribution of individual feature for scene recognition. In experiments, the NN is not good enough to express the similarity between two patterns. Furthermore, the selected features can not represent the scene thoroughly according to the state-of-art pattern recognition, which makes recognition not reliable[7].So in this work a new recognition system is presented, which is more reliable and effective if it is used in a complex mine environment. In this system, we improve the invariance by extracting salient local image regions as landmarks to replace the whole image to deal with large changes in scale, 2D rotation and viewpoint. And the number of interest points is reduced effectively, which makes the processing easier. Fuzzy recognition strategy is designed to recognize the landmarks in place of NN, which can strengthen the contribution of individual feature for scene recognition. Because of its partial information resuming ability, hidden Markov model is adopted to organize those landmarks, which can capture the structure or relationship among them. So scene recognition can be transformed to the evaluation problem of HMM, which makes recognition robust.2 Salient local image regions detectionResearches on biological vision system indicate that organism (like drosophila) often pays attention to certain special regions in the scene for their behavioral relevance or local image cues while observing surroundings [8]. These regions can be taken as natural landmarks to effectively represent and distinguish different environments. Inspired by those, we use center-surround difference method to detect salient regions in multi-scale image spaces. The opponencies of color and texture are computed to create the saliency map.Follow-up, sub-image centered at the salient position in S is taken as the landmark region. The size of the landmark region can be decided adaptively according to the changes of gradient orientation of the local image [11].Mobile robot navigation requires that natural landmarks should be detected stably when environments change to some extent. To validate the repeatability on landmark detection of our approach, we have done some experiments on the cases of scale, 2D rotation and viewpoint changes etc. Fig.1 shows that the door is detected for its saliency when viewpoint changes. More detailed analysis and results about scale and rotation can be found in our previous works[12].3 Scene recognition and localizationDifferent from other scene recognition systems, our system doesn’t need training offline. In other words, our scenes are not classified in advance. When robot wanders, scenes captured at intervals of fixed time are used to build the vertex of a topological map, which represents the place where robot locates. Although the map’s geometric layout is ignored by the localization system, it is useful for visualization and debugging[13] and beneficial to path planning. So localization means searching the best match of current scene on the map. In this paper hidden Markov model is used to organize the extracted landmarks from current scene and create the vertex of topological map for its partial information resuming ability.Resembled by panoramic vision system, robot looks around to get omni-images. FromFig.1 Experiment on viewpoint changeseach image, salient local regions are detected and formed to be a sequence, named as landmark sequence whose order is the same as the image sequence. Then a hidden Markov model is created based on the landmark sequence involving k salientlocal image regions, which is taken as the description of the place where the robot locates. In our system EVI-D70 camera has a view field of ±170°. Considering the overlap effect, we sample environment every 45° to get 8 images.Let the 8 images as hidden state Si (1≤i≤8), the created HMM can be illustrated by Fig.2. The parameters of HMM, aij and bjk, are achieved by learning, using Baulm-Welch algorithm[14]. The threshold of convergence is set as 0.001.As for the edge of topological map, we assign it with distance information between two vertices. The distances can be computed according to odometry readings.Fig.2 HMM of environmentTo locate itself on the topological map, robot must run its ‘eye’ on environment and extract a landmark sequence L1′ − Lk′ , then search the map for the best matched vertex (scene). Different from traditional probabilistic localization[15], in our system localization problem can be converted to the evaluation problem of HMM. The vertex with the greatest evaluation value, which must also be greater than a threshold, is taken as the best matched vertex, which indicates the most possible place where the robot is.4 Match strategy based on fuzzy logicOne of the key issues in image match problem is to choose the most effective features or descriptors to represent the original image. Due to robot movement, those extracted landmark regions will change at pixel level. So, the descriptors or features chosen should be invariant to some extent according to the changes of scale, rotation and viewpoint etc. In this paper, we use 4 features commonly adopted in the community that are briefly described as follows.GO: Gradient orientation. It has been proved that illumination and rotationchanges are likely to have less influence on it[5].ASM and ENT: Angular second moment and entropy, which are two texture descriptors.H: Hue, which is used to describe the fundamental information of the image.Another key issue in match problem is to choose a good match strategy or algorithm. Usually nearest neighbor strategy (NN) is used to measure the similarity between two patterns. But we have found in the experime nts that NN can’t adequately exhibit the individual descriptor or feature’s contribution to similarity measurement. As indicated in Fig.4, the input image Fig.4(a) comes from different view of Fig.4(b). But the distance between Figs.4(a) and (b) computed by Jefferey divergence is larger than Fig.4(c).To solve the problem, we design a new match algorithm based on fuzzy logic for exhibiting the subtle changes of each features. The algorithm is described as below.And the landmark in the database whose fused similarity degree is higher than any others is taken as the best match. The match results of Figs.2(b) and (c) are demonstrated by Fig.3. As indicated, this method can measure the similarity effectively between two patterns.Fig.3 Similarity computed using fuzzy strategy5 Experiments and analysisThe localization system has been implemented on a mobile robot, which is built by our laboratory. The vision system is composed of a CCD camera and a frame-grabber IVC-4200. The resolution of image is set to be 400×320 and the sample frequency is set to be 10 frames/s. The computer system is composed of 1 GHz processor and 512 M memory, which is carried by the robot. Presently the robot works in indoor environments.Because HMM is adopted to represent and recognize the scene, our system has the ability to capture the discrimination about distribution of salient local image regions and distinguish similar scenes effectively. Table 1 shows the recognition result of static environments including 5 laneways and a silo. 10 scenes are selected from each environment and HMMs are created for each scene. Then 20 scenes are collected when the robot enters each environment subsequently to match the 60 HMMs above.In the table, “truth” means that the scene to be localized matches with the right scene (the evaluation value of HMM is 30% greater than the second high evaluation). “Uncertainty” means that the evaluation value of HMM is greater than the second high evaluation under 10%. “Error match” means that the scene to be localized matches with the wrong scene. In the table, the ratio of error match is 0. But it is possible that the scene to be localized can’t match any scenes and new vertexes are created. Furthermore, the “ratio of truth” about silo is lower because salient cues are fewer in this kind of environment.In the period of automatic exploring, similar scenes can be combined. The process can be summarized as: when localization succeeds, the current landmark sequence is added to the accompanying observation sequence of the matched vertex un-repeatedly according to their orientation (including the angle of the image from which the salient local region and the heading of the robot come). The parameters of HMM are learned again.Compared with the approaches using appearance features of the whole image (Method 2, M2), our system (M1) uses local salient regions to localize and map, which makes it have more tolerance of scale, viewpoint changes caused by robot’smovement and higher ratio of recognition and fewer amount of vertices on the topological map. So, our system has better performance in dynamic environment. These can be seen in Table 2. Laneways 1, 2, 4, 5 are in operation where some miners are working, which puzzle the robot.6 Conclusions1) Salient local image features are extracted to replace the whole image to participate in recognition, which improve the tolerance of changes in scale, 2D rotation and viewpoint of environment image.2) Fuzzy logic is used to recognize the local image, and emphasize the individual feature’s contribution to recognition, which improves the reliability of landmarks.3) HMM is used to capture the structure or relationship of those local images, which converts the scene recognition problem into the evaluation problem of HMM.4) The results from the above experiments demonstrate that the mine rescue robot scene recognition system has higher ratio of recognition and localization.Future work will be focused on using HMM to deal with the uncertainty of localization.中文翻译基于视觉的矿井救援机器人场景识别摘要:基于模糊逻辑和隐马尔可夫模型(HMM),论文提出了一个新的场景识别系统,可应用于紧急情况下矿山救援机器人的定位。
matlab中英文翻译文献
附录英文原文Scene recognition for mine rescue robotlocalization based on visionAbstract:A new scene recognition system was presented based on fuzzy logic and hidden Markov model(HMM) that can be applied in mine rescue robot localization during emergencies. The system uses monocular camera to acquire omni-directional images of the mine environment where the robot locates. By adopting center-surround difference method, the salient local image regions are extracted from the images as natural landmarks. These landmarks are organized by using HMM to represent the scene where the robot is, and fuzzy logic strategy is used to match the scene and landmark. By this way, the localization problem, which is the scene recognition problem in the system, can be converted into the evaluation problem of HMM. The contributions of these skills make the system have the ability to deal with changes in scale, 2D rotation and viewpoint. The results of experiments also prove that the system has higher ratio of recognition and localization in both static and dynamic mine environments.Key words: robot location; scene recognition; salient image; matching strategy; fuzzy logic; hidden Markov model1 IntroductionSearch and rescue in disaster area in the domain of robot is a burgeoning and challenging subject[1]. Mine rescue robot was developed to enter mines during emergencies to locate possible escape routes for those trapped inside and determine whether it is safe for human to enter or not. Localization is a fundamental problem in this field. Localization methods based on camera can be mainly classified into geometric, topological or hybrid ones[2]. With its feasibility and effectiveness, scene recognition becomes one of the important technologies of topological localization.Currently most scene recognition methods are based on global image features and have two distinct stages: training offline and matching online.During the training stage, robot collects the images of the environment where it works and processes the images to extract global features that represent the scene. Some approaches were used to analyze the data-set of image directly and some primary features were found, such as the PCA method [3]. However, the PCA method is not effective in distinguishing the classes of features. Another type of approach uses appearance features including color, texture and edge density to represent the image. For example, ZHOU et al[4] used multidimensional histograms to describe global appearance features. This method is simple but sensitive to scale and illumination changes. In fact, all kinds of global image features are suffered from the change of environment.LOWE [5] presented a SIFT method that uses similarity invariant descriptors formed by characteristic scale and orientation at interest points to obtain the features. The features are invariant to image scaling, translation, rotation and partially invariant to illumination changes. But SIFT may generate 1 000 or more interest points, which may slow down the processor dramatically.During the matching stage, nearest neighbor strategy(NN) is widely adopted for its facility and intelligibility[6]. But it cannot capture the contribution of individual feature for scene recognition. In experiments, the NN is not good enough to express the similarity between two patterns. Furthermore, the selected features can not represent the scene thoroughly according to the state-of-art pattern recognition, which makes recognition not reliable[7].So in this work a new recognition system is presented, which is more reliable and effective if it is used in a complex mine environment. In this system, we improve the invariance by extracting salient local image regions as landmarks to replace the whole image to deal with large changes in scale, 2D rotation and viewpoint. And the number of interest points is reduced effectively, which makes the processing easier. Fuzzy recognition strategy is designed to recognize the landmarks in place of NN, which can strengthen the contribution of individual feature for scene recognition. Because of its partial information resuming ability, hidden Markov model is adopted to organize those landmarks, which can capture the structure or relationship among them. So scene recognition can be transformed to the evaluation problem of HMM, which makes recognition robust.2 Salient local image regions detectionResearches on biological vision system indicate that organism (like drosophila) often pays attention to certain special regions in the scene for their behavioral relevance or local image cues while observing surroundings [8]. These regions can be taken as natural landmarks to effectively represent and distinguish different environments. Inspired by those, we use center-surround difference method to detect salient regions in multi-scale image spaces. The opponencies of color and texture are computed to create the saliency map.Follow-up, sub-image centered at the salient position in S is taken as the landmark region. The size of the landmark region can be decided adaptively according to the changes of gradient orientation of the local image [11].Mobile robot navigation requires that natural landmarks should be detected stably when environments change to some extent. To validate the repeatability on landmark detection of our approach, we have done some experiments on the cases of scale, 2D rotation and viewpoint changes etc. Fig.1 shows that the door is detected for its saliency when viewpoint changes. More detailed analysis and results about scale and rotation can be found in our previous works[12].3 Scene recognition and localizationDifferent from other scene recognition systems, our system doesn’t need training offline. In other words, our scenes are not classified in advance. When robot wanders, scenes captured at intervals of fixed time are used to build the vertex of a topological map, which represents the place where robot locates. Although the map’s geometric layout is ignored by the localization system, it is useful for visualization and debugging[13] and beneficial to path planning. So localization means searching the best match of current scene on the map. In this paper hidden Markov model is used to organize the extracted landmarks from current scene and create the vertex of topological map for its partial information resuming ability.Resembled by panoramic vision system, robot looks around to get omni-images. FromFig.1 Experiment on viewpoint changeseach image, salient local regions are detected and formed to be a sequence, named as landmark sequence whose order is the same as the image sequence. Then a hidden Markov model is created based on the landmark sequence involving k salientlocal image regions, which is taken as the description of the place where the robot locates. In our system EVI-D70 camera has a view field of ±170°. Considering the overlap effect, we sample environment every 45° to get 8 images.Let the 8 images as hidden state Si (1≤i≤8), the created HMM can be illustrated by Fig.2. The parameters of HMM, aij and bjk, are achieved by learning, using Baulm-Welch algorithm[14]. The threshold of convergence is set as 0.001.As for the edge of topological map, we assign it with distance information between two vertices. The distances can be computed according to odometry readings.Fig.2 HMM of environmentTo locate itself on the topological map, robot must run its ‘eye’ on environment and extract a landmark sequence L1′ − Lk′ , then search the map for the best matched vertex (scene). Different from traditional probabilistic localization[15], in our system localization problem can be converted to the evaluation problem of HMM. The vertex with the greatest evaluation value, which must also be greater than a threshold, is taken as the best matched vertex, which indicates the most possible place where the robot is.4 Match strategy based on fuzzy logicOne of the key issues in image match problem is to choose the most effective features or descriptors to represent the original image. Due to robot movement, those extracted landmark regions will change at pixel level. So, the descriptors or features chosen should be invariant to some extent according to the changes of scale, rotation and viewpoint etc. In this paper, we use 4 features commonly adopted in the community that are briefly described as follows.GO: Gradient orientation. It has been proved that illumination and rotationchanges are likely to have less influence on it[5].ASM and ENT: Angular second moment and entropy, which are two texture descriptors.H: Hue, which is used to describe the fundamental information of the image.Another key issue in match problem is to choose a good match strategy or algorithm. Usually nearest neighbor strategy (NN) is used to measure the similarity between two patterns. But we have found in the experiments that NN can’t adequately exhibit the individual descriptor or feature’s contribution to similarity measurement. As indicated in Fig.4, the input image Fig.4(a) comes from different view of Fig.4(b). But the distance between Figs.4(a) and (b) computed by Jefferey divergence is larger than Fig.4(c).To solve the problem, we design a new match algorithm based on fuzzy logic for exhibiting the subtle changes of each features. The algorithm is described as below.And the landmark in the database whose fused similarity degree is higher than any others is taken as the best match. The match results of Figs.2(b) and (c) are demonstrated by Fig.3. As indicated, this method can measure the similarity effectively between two patterns.Fig.3 Similarity computed using fuzzy strategy5 Experiments and analysisThe localization system has been implemented on a mobile robot, which is built by our laboratory. The vision system is composed of a CCD camera and a frame-grabber IVC-4200. The resolution of image is set to be 400×320 and the sample frequency is set to be 10 frames/s. The computer system is composed of 1 GHz processor and 512 M memory, which is carried by the robot. Presently the robot works in indoor environments.Because HMM is adopted to represent and recognize the scene, our system has the ability to capture the discrimination about distribution of salient local image regions and distinguish similar scenes effectively. Table 1 shows the recognition result of static environments including 5 laneways and a silo. 10 scenes are selected from each environment and HMMs are created for each scene. Then 20 scenes are collected when the robot enters each environment subsequently to match the 60 HMMs above.In the table, “truth” means that the scene to be localized matches with the right scene (the evaluation value of HMM is 30% greater than the second high evaluation). “Uncertainty” means that the ev aluation value of HMM is greater than the second high evaluation under 10%. “Error match” means that the scene to be localized matches with the wrong scene. In the table, the ratio of error match is 0. But it is possible that the scene to be localized can’t match any scenes and new vertexes are created. Furthermore, the “ratio of truth” about silo is lower because salient cues are fewer in this kind of environment.In the period of automatic exploring, similar scenes can be combined. The process can be summarized as: when localization succeeds, the current landmark sequence is added to the accompanying observation sequence of the matched vertex un-repeatedly according to their orientation (including the angle of the image from which the salient local region and the heading of the robot come). The parameters of HMM are learned again.Compared with the approaches using appearance features of the whole image (Method 2, M2), our system (M1) uses local salient regions to localize and map, which makes it have more tolerance of scale, viewpoint changes caused by robot’smovement and higher ratio of recognition and fewer amount of vertices on the topological map. So, our system has better performance in dynamic environment. These can be seen in Table 2. Laneways 1, 2, 4, 5 are in operation where some miners are working, which puzzle the robot.6 Conclusions1) Salient local image features are extracted to replace the whole image to participate in recognition, which improve the tolerance of changes in scale, 2D rotation and viewpoint of environment image.2) Fuzzy logic is used to recognize the local image, and emphasize the individual feature’s contribution to recognition, which improves the reliability of landmarks.3) HMM is used to capture the structure or relationship of those local images, which converts the scene recognition problem into the evaluation problem of HMM.4) The results from the above experiments demonstrate that the mine rescue robot scene recognition system has higher ratio of recognition and localization.Future work will be focused on using HMM to deal with the uncertainty of localization.中文翻译基于视觉的矿井救援机器人场景识别摘要:基于模糊逻辑和隐马尔可夫模型(HMM),论文提出了一个新的场景识别系统,可应用于紧急情况下矿山救援机器人的定位。
外文翻译 matlab 介绍大学论文
外文原文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 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. This 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 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 available.Advantages of MATLABMATLAB has many advantages compared 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 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 prototyping of new programs.Many program development tools are provided to make the program easy to use. a workspace browser, and extensive demos.2.Platform independenceMATLAB is supported on many different computer systems, providing a large measure of platform independence. At the time of this writing, the language issupported 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 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 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 hundreds 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 standard 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 PlottingUnlike most other computer languages, MATLAB has many integral plotting 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 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 inexperienced users.6.MATLAB CompilerMATLAB′s flexibility and platform independence is achieved by compilingMATLAB 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 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 aMATLAB program into a true 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 MATLABMATLAB 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 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 times 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 purchasing. Fortunately, there is also an 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 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.Introduction To Top-Down Design TechniquesSuppose 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 thinking about the problemfirst. 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. For 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. For 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, “programming 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 really understood the problem, it became easy to break the problem apart into smaller, 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 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 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 state 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 clear 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 andunknown 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 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 the 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 be produced by theprogram.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 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 required by the programs that may follow it in the overall processing scheme, and to write out those answers in the format needed by 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 within 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 simple, 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 functions 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 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 process 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 tested 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 produces the wrong answers (or crashes) with adifferent 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 through 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 program 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 combinations 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 (矩阵实验室的简称)是一种专业的计算机程序,用于工程科学的矩阵数学运算。
MATLAB在信息类课程双语教学中的应用共5页word资料
MATLAB在信息类课程双语教学中的应用基金项目:本文系宁波市重点专业“电子信息科学与技术”建设子项目“双语课教学研究”的研究成果。
随着经济的全球化,国际合作与文化交流日益频繁,具备良好外语交流能力又有扎实专业知识技能的复合型人才越来越受到社会的青睐。
双语教学作为一种新的教学方式,正成为国内高等教育改革的热点,被认为是培养复合型、国际性人才的一个重要途径。
信息技术是目前发展最为迅速、国际合作与文化交流最为频繁的一个技术领域。
该领域的新技术、新产品层出不穷,知识更新极快。
因此,对于国内高校信息类专业,客观上存在着实施双语教学的必要性,可以使学生尽早了解和学习本领域的最前沿技术。
同时,信息类课程是信息技术快速发展的基础。
学好信息类课程,掌握相关知识与技术,对进一步推动信息技术的快速发展是极其重要的。
然而,高校信息类课程大多理论性和实践性都很强,概念抽象,数学推导较多,计算量极大,如果不借助于软件进行计算机编程仿真,学习者将很难得到形象化的结果,对知识点的理解就难以透彻。
一、MATLAB简介MATLAB是美国MathWorks公司推出的一套高性能科学计算软件,它集数值分析、矩阵运算、信号处理和图形显示于一体,构成了一个操作简便、界面友好的图形用户环境。
MATLAB软件的最大特点在于内建了应用于许多学科(包括信息学科)的工具箱,例如信号处理、图像处理和通信系统等工具箱。
这些工具箱包含了由各自领域专家编写的一系列函数,可以很方便地用于信息类课程的计算机辅助教学。
同时,MATLAB又是一款纯英文版软件,对每一个函数均提供了关于函数功能、调用格式等方面信息的帮助说明。
由于这些函数与各自学科知识点紧密关联,因此,完全可以把这些“原汁原味”的帮助信息作为双语课程教学内容的一部分。
这既是初学者扩大英语专业词汇量,掌握和理解大量专业术语,提高双语课程阅读能力的一个很好途径,也是初学者学习和使用MATLAB函数的前提。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
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 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. This 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 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 available.Advantages of MATLABMATLAB has many advantages compared 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 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 thelanguage is so easy to use, it is ideal for educational use, and for the rapid prototyping of new programs.Many program development tools are provided to make the program easy to use. a workspace browser, and extensive demos.2.Platform independenceMATLAB is supported on many different computer systems, providinga 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 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 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 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 hundreds 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 standard 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 freeuser-contributed MATLAB programs that are shared through the MATLAB Web site.4.Device-Independent PlottingUnlike most other computer languages, MATLAB has many integral plotting 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 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 inexperienced users. 6.MATLAB CompilerMATLAB′s flexibility 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.Unfortunately, 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 compilea MATLAB program into a true executable that runs faster than theinterpreted code. It is a great way to convert a prototype MATLAB program into an executable suitable for sale and distribution to users. Disadvantages of MATLABMATLAB 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 properly structuring theMATLAB 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 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, 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 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.Introduction To Top-Down Design TechniquesSuppose 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 thinking 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. For 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 thenapply 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 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, “programming 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 really understood the problem, it became easy to break the problem apart into smaller, 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 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 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 state 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 clear enough to allow a programmer to design a program to meet the need; he or she must first know much moreabout 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 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 the 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 linearequations 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 producedby 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 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 required by the programs that may follow it in the overall processing scheme, and to write out those answers in the format needed by 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 within 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 simple, 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 functions 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 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 process 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 tested 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 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 through 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 program 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 combinations ofthe 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 2MATLAB 介绍MATLAB (矩阵实验室的简称)是一种专业的计算机程序,用于工程科学的矩阵数学运算。