【正文】
. An algorithm is a stepbystep procedure for finding the solution to a problem. It is at this stage in the process that topdown design techniques e into play. The designer looks for logical divisions within the problem, and divides it up into subtasks along those lines. This process is called deposition. If the subtasks are large, the designer can break them up into even smaller subtasks. 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 deposed 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 deposition and stepwise refinement to the problem. 4. Turn the algorithm into MATLAB statements. If the deposition 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 oneforone basis. 5. Test the resulting MATLAB program This step is the real killer. The ponents 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 mon 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 本科生畢業(yè)設(shè)計(論文 ) 外文翻譯 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 pleted, the program goes through a series of builds, during which the individual subtasks are bined 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 binations of the subtasks. In successive builds, more and more subtasks are added, until the entire program is plete. Testing is performed on each build, and any errors(bugs) detected are corrected before moving on to the next build. Figure 2 本科生畢業(yè)設(shè)計(論文 ) 外文翻譯 中文翻譯 MATLAB 介紹 MATLAB (矩陣實驗室的簡稱 )是一種專業(yè)的計算機程序,用于工程科學(xué)的矩陣數(shù)學(xué)運算。但在以后的幾年內(nèi),它逐漸發(fā) 展為一種極其靈活的計算體系,用于解決各種重要的技術(shù)問題。 MATLAB 程序執(zhí)行 MATLAB 語言,并提供了一個極其廣泛的預(yù)定義函數(shù)庫,這樣就使得技術(shù)工作變得簡單高效。本書將介紹 MATLAB 語言,并向大家展示如何運用它去解決經(jīng)典的技術(shù)問題。 MATLAB 是一個龐大的程序,擁有難以置信的各種豐富的函數(shù);即使基本版本的 MATLAB 語言擁有的函數(shù)也比其他的工程編程語言要豐富的多?;镜腗ATLAB 語言已經(jīng)擁有了超過 1000 多個函數(shù),而它的工具包帶有更多的函數(shù),由此擴展了它在許多專業(yè)領(lǐng)域的能力。本書無意將 MATLAB 的所有函數(shù)介紹給大家,而是讓大家掌握編寫調(diào)試和優(yōu)化程序的基本