Create a row vector with 16 equally spaced elements in which the first element is 5 and the last element is 61. Create a column vector with 14 equally spaced elements in which the first element is 3 and the last element is -36. Using the colon symbol, create a row vector (assign it to a variable named same) with eleven elements that are all 4.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
5. Create a row vector with 16 equally spaced elements in which the first element is
5 and the last element is 61.
6. Create a column vector with 14 equally spaced elements in which the first element
is 3 and the last element is -36.
7. Using the colon symbol, create a row vector (assign it to a variable named same)
with eleven elements that are all 4.
8. Create a vector, name it Afirst, that has 13 elements in which the first is 3, the
increment is 4 and the last element is 51. Then, using the colon symbol, create a
new vector, call it Asecond, that has seven elements. The first four elements are
the first four elements of the vector Afirst, and the last three are the last three
elements of the vector Afirst.
9. Using the colon symbol, create a 3×5 matrix (assign it to a variable named
msame) in which all the elements are the number 7.
10. Create three vectors:
a = [2 -1 0 6], 6 = [-5 20 12 –3], e = [10 7 –2 i]
a) Use the three vectors in a MATLAB command to create a 3x4 matrix in
which the rows are the vectors a, b, and c.
b) Use the three vectors in a MATLAB command to create a 4x3 matrix in
which the columns are the vectors a, b, and c.
11. By hand (pencil and paper) write what will be displayed if the following
commands are executed by MATLAB. Check your answers by executing the
commands with MATLAB. (Parts b, c, and d use the vector that was defined in
part a).
a) a=0:2:6
b) b=[a a] or b=[a, a]
c) c= [a; a]
d) d=[a' a' ] or d=[a', a']
12. The following vector is defined in MATLAB:
v - [2, 7, -3, 5, 0, 14, –1, 10, -6, 8]
By hand (pencil and paper) write what will be displayed if the following
commands are executed by MATLAB. Check your answers by executing the
commands with MATLAB.
a) a=v (3:6)
b) b=v ([2,4:7,10])
c) c=v ([9,3,1,10])
d) d=[v([1,3 5]);v([2,4,61);v([3,6,91) ]
Transcribed Image Text:5. Create a row vector with 16 equally spaced elements in which the first element is 5 and the last element is 61. 6. Create a column vector with 14 equally spaced elements in which the first element is 3 and the last element is -36. 7. Using the colon symbol, create a row vector (assign it to a variable named same) with eleven elements that are all 4. 8. Create a vector, name it Afirst, that has 13 elements in which the first is 3, the increment is 4 and the last element is 51. Then, using the colon symbol, create a new vector, call it Asecond, that has seven elements. The first four elements are the first four elements of the vector Afirst, and the last three are the last three elements of the vector Afirst. 9. Using the colon symbol, create a 3×5 matrix (assign it to a variable named msame) in which all the elements are the number 7. 10. Create three vectors: a = [2 -1 0 6], 6 = [-5 20 12 –3], e = [10 7 –2 i] a) Use the three vectors in a MATLAB command to create a 3x4 matrix in which the rows are the vectors a, b, and c. b) Use the three vectors in a MATLAB command to create a 4x3 matrix in which the columns are the vectors a, b, and c. 11. By hand (pencil and paper) write what will be displayed if the following commands are executed by MATLAB. Check your answers by executing the commands with MATLAB. (Parts b, c, and d use the vector that was defined in part a). a) a=0:2:6 b) b=[a a] or b=[a, a] c) c= [a; a] d) d=[a' a' ] or d=[a', a'] 12. The following vector is defined in MATLAB: v - [2, 7, -3, 5, 0, 14, –1, 10, -6, 8] By hand (pencil and paper) write what will be displayed if the following commands are executed by MATLAB. Check your answers by executing the commands with MATLAB. a) a=v (3:6) b) b=v ([2,4:7,10]) c) c=v ([9,3,1,10]) d) d=[v([1,3 5]);v([2,4,61);v([3,6,91) ]
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY