
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
![Using a for-loop in Matlab for the given vectors
V=[17,9,3,6, 10];
W=[9,6, 7,7, 1];
a) Write a program (using for-loop) that calculates the dot-product, C=(V-W).W
b) What is the value of C?
Choices
280
63
68
64
Submit I Attempts 1I](https://content.bartleby.com/qna-images/question/97234a29-7009-4d8e-8d71-9606bd71717d/c5664049-be3c-4d27-9aa0-c3b0b9d73d72/p7uybg_thumbnail.png)
Transcribed Image Text:Using a for-loop in Matlab for the given vectors
V=[17,9,3,6, 10];
W=[9,6, 7,7, 1];
a) Write a program (using for-loop) that calculates the dot-product, C=(V-W).W
b) What is the value of C?
Choices
280
63
68
64
Submit I Attempts 1I
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 2 images

Knowledge Booster
Similar questions
- Using Matlab,please code the following problem. The concentration (C) of insulin in the body is described by the following equationC = C0e^-40t / MWhereC0 = 85 pmol/L is the initial insulin concentration, t is time in minutes, M is the personmass in kg.a) Write code that will calculate the insulin concentration of two people with weighs 60Kg and 100 Kg. Simulate the insulin concentration for 4 minutes in steps of 0.1minute.b) Plot the insulin concentration of the two people on the same graph. For the firstcurve plot a magenta solid line, square marker, cyan for MarkerFaceColor, andMarkerSize of 6. For the second curve plot a black dashed line with LineWidth of 2.c) Your plot should have a title, a legend, and appropriate labels for the x and y axis.arrow_forwardQ1- Example 1: Write a program that solves a quadratic equation using Quadratic equation -b± vb² – 4ac 2a b² – 4ac > 0 -b b² – 4ac = 0 2a If the sub-radical value is less than zero, print the expression (the root is complex) Q2:- write matlab code to sum the following x3 + x7arrow_forwardExample-The Factorial Function To illustrate the operation of a for loop, we will use a for loop to calculate the factorial function. The factorial function is defined as n = 0 – 1) × (n – 2) × ... X 2x1 n>0 n! = (5.3) The MATLAB code to calculate N factorial for positive value of N would be n_factorial = 1 for ii = 1:n n_factorial = n_factorial * ii; end Suppose that we wish to calculate the value of 5!. If n is 5, the for loop control expression would be the row vector [1 2 3 4 5]. This loop will be executed 5 times, with the variable ii taking on values of 1, 2, 3, 4, and 5 in the successive loops. The resulting value of n_factorial will be 1 X 2 x 3 x 4 x 5 = 120. MATLAB includes a standard function called zactoriai to calculate the factorial function. Use the MATLAB help system to look up this function. Calculate 71, 141, and 21! using the program ini this example 7! = 14! = 21! = Calculate 7!, 14!, and 21! using the factorial function. 7! = 14! = 21! = How do the results compare?arrow_forward
- The point P has coordinates x = -3 m and y = 4 m relative to the origin O. The vector v is v = -4î + 4î m/s. Matlab Mathematica Python SymPy from sympy import * Px = -3 Py = 4 v = Matrix([-4, 4, 0]) copy this text What is the orthogonal projection of v onto the vector û = -ếg associated with the polar coordinates for point P? Proj(t, й) — e î+ e jm/sarrow_forwardPlease solve using scilab, please add photo of code if possible. Existing answers on Bartleby are incorrect.arrow_forwardhelparrow_forward
- Q20: Assuming an initially empty 2-way set associative cache with al block size of 2 words and a total of 4 sets, which is using a LRU replacement policy. Complete the following table showing the cache after all the following block accesses: Set index V TAG 1 2 3 1, 5, 2, 1, 3, 9 DATA DATA V TAG DATA DATAarrow_forwardInitialize a vector v1 with the following values: 0 23 -7 8 -22 3 14 Write a MATLAB program from the values in v1. The vector v2 should contain the values in v1 transformed as follows: that uses a for-loop and if-statements to make a new vector v2 multiply each positive even element in v1 by 3, multiply each positive odd element of v1 by -2, and change the sign of the negative elements in v1. Then, output the new vector to the command window as follows: The new vector is: -46 7 24 22 -6 42 Also, compute and output the mean of the values in the new vector: The mean of the new vector is: xxxx Above, xxxx is the mean of the values in the new vector with 1 decimal place.arrow_forwardCode with Matlab please.arrow_forward
- Using a for-loop in Matlab for the given vectors V=[17,9, 3, 6, 10]; W=[9, 6, 7,7, 1]; a) Write a program (using for-loop) that calculates the dot-product, C=(V-W).W b) What is the value of C? Choices 280 63 68 64 Submit I Attempts 1 |arrow_forwardDescribe what the following code is doing (the outcome), by annotating each line of code and giving an overall description of the function of the code. Also, perform a desk check (trace) of the program. Must show multiple iterations of the program loops in the desk check (trace). MOV RO, #100 MOV R1, #2O Loop: CMP RO, R1 BEQ Stop BLT Less SUB RO, RO, R1 BAL Loop Less: SUB R1, R1, RO BAL Loop Stop: MOV R7, #1 SWI Oarrow_forwardQuiz)A vector is given by x-[-3.5 5 -6.2 11.1 e 7 -9.5 2 15 -1 3] Using conditional statements and loops write a program that rearranges the elements of x in order from the smallest to t he largest. Do not use MATLAB's built-in function Iarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

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 Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

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
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY