ENGIN 7 Study Guide - Midterm Guide: Nan, Matlab

24 views8 pages
8 Jan 2019
School
Department
Course
Professor

Document Summary

1 or 2 (please circle your discussion section ) #22: tuth 4-6 (please circle your lab section) Let two matlab arrays a and b be de ned as. Record the output of the following matlab commands: Part b (8 points) suppose that the following code is executed. clear. B. 1 (1 point) write a 1-line command that returns the contents of cell (1,2) of a. B. 2 (1 point) write a 1-line command that changes the second word in the contents of cell (1,2) of a to "earth". B. 3 (1 point) what does class(a{2,1}) return? cell. B. 5 (4 points) in the space provided below, sketch the graph produced by executing the matlab statement below. Write error if the code produces an error. 1 plot(a{1,1},a{2,2}{2}(a{1,1})) 1plot(x,y) plots the elements of vector y (vertical axis) versus elements of vector x (horizontal axis). Write the outputs of the following matlab commands: Let the function m- le myfun. m be given by function r = myfun(x)