第二章MATLAB语言的使用与程序设计习题.docVIP

  • 41
  • 0
  • 约3.1万字
  • 约 43页
  • 2019-08-18 发布于北京
  • 举报

第二章MATLAB语言的使用与程序设计习题.doc

第二章MATLAB语言的使用与程序设计习题.doc

控制系统仿真 Control System Simulation 习 题 集 辽宁科技大学电子与信息工程学院 二零零七年九月 目 录 TOC \o 1-1 \h \z \u 练习一 1 练习二 3 练习三 5 练习四 6 练习五 8 练习六 9 练习七 13 练习八 14 练习九 15 练习十 16 练习十一 17 练习十二 18 控制系统仿真期末考试模拟题 19 附录(参考答案) 23 PAGE 2 练习一 1. Create a vector of the even whole numbers between 31 and 75. 2. Let x = [2 5 1 6]. a. Add 16 to each element b. Add 3 to just the odd-index elements c. Compute the square root of each element d. Compute the square of each element 3. Let x = [3 2 6 8] and y = [4 1 3 5] (NB. x and y should be column vectors). a. Add the sum of the elements in x to y b. Raise each element of x to the power specified by the corresponding element in y. c. Divide each element of y by the corresponding element in x d. Multiply each element in x by the corresponding element in y, calling the result z. e. Add up the elements in z and assign the result to a variable called w. f. Compute x*y - w and interpret the result 4. Evaluate the following MATLAB expressions by hand and use MATLAB to check the answers a. 2 / 2 * 3 b. 6 - 2 / 5 + 7 ^ 2 - 1 c. 10 / 2 \ 5 - 3 + 2 * 4 d. 3 ^ 2 / 4 e. 3 ^ 2 ^ 2 f. 2 + round(6 / 9 + 3 * 2) / 2 - 3 g. 2 + floor(6 / 9 + 3 * 2) / 2 - 3 h. 2 + ceil(6 / 9 + 3 * 2) / 2 - 3 5. Create a vector x with the elements ... a. 2, 4, 6, 8, ... b. 10, 8, 6, 4, 2, 0, -2, -4 c. 1, 1/2, 1/3, 1/4, 1/5, ... d. 0, 1/2, 2/3, 3/4, 4/5, ... 6. Create a vector x with the elements, xn = (-1)n+1/(2n-1) Add up the elements of the version of this vector that has 100 elements. 7. Given a vector, t, of length n, write down the MATLAB expressions that will correctly compute the following: a. ln(2 + t + t2) b. et(1 + cos(3t)) c. cos2(t) + sin2(t) d. tan-1(1) (this is the inverse tangent function) e. cot(t) f. sec2(t) + cot(t) - 1 Test that your solution works for t = 1:0.2:2 8. Plot the functio

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档