Practice Problems (3) 1. 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.

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
Practice Problems (3)
1. 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.
2. Let x = [3 2 6 8] and y = [4 135]
a) Add 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".
3. When A and B contain the values shown below, give the values of C vector after
executing the following statements.
A = [2-150]; B = [3 2 -14]
a) C = A-B
b) C = B + A-3
c) C = B./A
d) C = A.^B
e) C = 2.^B+A
f) C = 2*A+A.^B
4. Use the linspace commands to create 4 vectors a, b, c, d with the elements:
a) 2, 4, 6, 8... to 10 elements
b) 10, 8, 6, 4, 2, 0, -2, -4...to 15 elements
c) 1, 1/2, 1/3, 1/4, 1/5... to 10 elements
d) 0, 1/2, 2/3, 3/4, 4/5... to 10 elements
5. Compute the average molecular weight of a mixture of equal fractions of CH4,
H2,
O2, CO, CO2, H2O, CH3OH, C2H6.
The average molecular weight: Mw Σ Mw₁ X X₁
-
average
i=1
Transcribed Image Text:Practice Problems (3) 1. 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. 2. Let x = [3 2 6 8] and y = [4 135] a) Add 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". 3. When A and B contain the values shown below, give the values of C vector after executing the following statements. A = [2-150]; B = [3 2 -14] a) C = A-B b) C = B + A-3 c) C = B./A d) C = A.^B e) C = 2.^B+A f) C = 2*A+A.^B 4. Use the linspace commands to create 4 vectors a, b, c, d with the elements: a) 2, 4, 6, 8... to 10 elements b) 10, 8, 6, 4, 2, 0, -2, -4...to 15 elements c) 1, 1/2, 1/3, 1/4, 1/5... to 10 elements d) 0, 1/2, 2/3, 3/4, 4/5... to 10 elements 5. Compute the average molecular weight of a mixture of equal fractions of CH4, H2, O2, CO, CO2, H2O, CH3OH, C2H6. The average molecular weight: Mw Σ Mw₁ X X₁ - average i=1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 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