Question: IN MATLAB. Problem 2. Write a function called vector_multiply that takes two vectors of the same length as input arguments (the function does not have

IN MATLAB.
Problem 2. Write a function called vector_multiply that takes two vectors of the same length as input arguments (the function does not have to check the format of the input) and returns one row vector as output. If it is called like this v3 vector_multiply (v1,v2), then v3v1.*v2. However, this function must not use an array operation. It must instead use a for-loop Problem 4. Write a function called summit that takes three vectors of the same length as input arguments (the function does not have to check the format of the input) and retums a scalar as output. If it is called like this, a = summit (x,y,z) then a- x(1)A2+ y(1)*z(1) + x(2)A2 + y(2) z(2) +... +x(N)A2 + y(N)*z(N) where N equals the length of x. This function must not use an array operation, and it must not use the function sum. Instead, it must instead use a forloop Problem 12. Using only while loops, write a function called leaps that takes one scalar as an input argument (the function does not have to check the format of the input) and returns one scalar as an output argument. If it is called this way, n leaps(d), then it sets n equal to the minimum number of leaps required to move from a wall to a distance at least d feet from the wall. The first step is 1 foot. If a second step is required, it is 2 feet. If a third step is required, it is 3 feet If a fourth step is required, it is 4 feet, and so forth. Here are some sample runs >> leaps(0) ans = >>leaps(1) ans = >> leaps(100) ans 14
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
