资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
注:1、教师命题时题目之间不留空白; 2、考生不得在试题纸上答题,教师只批阅答题册正面部分,若考生须在试题图上作解答,请另附该试题图。3、请在试卷类型、考试方式后打勾注明。(第 1 页)试 题2010 年 2011 年第 1 学期课程名称: MATLAB 语言 专业年级:电子信息工程 2009 级考生学号: 考生姓名: 试卷类型: A 卷 B 卷 考试方式: 开卷 闭卷 1. Fill the blanks. (10 marks, 2 marks per blank. )(1) In MATLAB, the subscripts of rows and columns start from _.(2) Suppose that d=1,2 . Then the statement d(4)=4 will produce the array d = _.(3) The function _ computes the conjugate of a complex number.(4) One can hide the axis of a figure by using the command _ in MATLAB.(5) The MATLAB statement to create an mn random array which is uniformly distributed in -5,5 is _.2. True or false. (10 marks, 2 marks per judgment. )(1) MATLAB always allocates array elements in row major order. ( )(2) Variables with the name such as _Vari_naMe will be legally created by the MATLAB. ( )(3) The lookfor command searches for an exact function name match, whereas the help command searches the quick summary information in each function for a match. ( )(4) Use the char function to create two-dimensional character arrays without worrying about padding each row to the same length. ( )(5) In certain cases, a MATLAB function can be called with less input arguments than it is defined. ( )3. Short Answers. ( 15 marks, 5 marks per question. )(1) Please list three ways to calculate the inverse of a matrix A, in which A is supposed to be a 33 matrix.(2) Please list three cases in which we should use parentheses.(3) What are the advantages of using function handle?4. Applications. ( 65 marks )(1) Assume that A is defined as follows: 注:1、教师命题时题目之间不留空白; 2、考生不得在试题纸上答题,教师只批阅答题册正面部分,若考生须在试题图上作解答,请另附该试题图。3、请在试卷类型、考试方式后打勾注明。(第 2 页)123A456789Determine the results after the following statements are evaluated. (The result of each statement does not interfere with each other. 12 marks )1) A ( 1 , 3, : ) = A ( 3 , 1, : ) 2) B = A - 53) C = A(1:4), A(5:6) 4) D = mean(A)(2) Write the MATLAB statements to calculate the values of the function2350()tftfor values of t between -9 and 9 in steps of 0.5. Do this twice, once using loops and branches, and once using vectorized code. (12 marks )(3) Create a figure with two subplots arranged in rows. In the left subplot, draw a plot defined by the exponential function in a blue line together with its 1xyeasymptote(渐近线) in a red line, for at interval of 0.01, and limit 1y5the axis within , . In the right subplot, create a mesh plot defined 52xby , for , at interval of 0.01. Just plot the real XiYZe 2Ypart of Z versus X and Y. ( 16 marks )(4) Determine the results of ires after each of the following programs are evaluated. (12 marks, 3 marks each )1) ires = 0;for ii= 1:5 ; 6:10ires = ires + ii;end2) ires = 0;for index = 10:(-2):4if index = 0continue;endires = ires + index;注:1、教师命题时题目之间不留空白; 2、考生不得在试题纸上答题,教师只批阅答题册正面部分,若考生须在试题图上作解答,请另附该试题图。3、请在试卷类型、考试方式后打勾注明。(第 3 页)end3) ires = 2;while ires 200ires = ires 2;end4) ires = 1, 2, 3, 4; 5, 6, 7, 8; 9, 10, 11, 12; arr = ires b or 0 if a = b.% a, b - fractions in vector forms, in which both are 1*2 vectors.% to check whether just two input arguments are passed into the functionerror( _ ); % Blank 1% to check whether both the two fractions are expressed by 1*2 vectorsif _ % Blank 2error(The two fractions should be both expressed by 1*2 vectors);end% to calculate the lease common multiple of the two denominatorslcmab = _; % Blank 3% to compare the two fraction by reduction to a common denominatorif _ % Blank 4res = 1elseres = 0end
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号