Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Create a vector of the even whole numbers between 3 1 and 7 5 . 2 . Create a vector x with 1

1. Create a vector of the even whole numbers between 31 and 75.
2. Create a vector x with 100 elements (try to use linspace function if possible).
a)2,4,6,8,...
b)10,8,6,4,2,0,-2,-4,...
c)1/2,2/3,3/4,4/5,..., n/(n+1)
d)0,1/2,2/3,3/4,4/5,..., n/(n+1)
3. Let x =[2516].
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
4. Let x =[3268]' and y =[4135]'(Note: x and y should be column vectors).
a. Add the sum of 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".
e. Add up the elements in z and assign the result to a variable called "w".
f. Compute x'*y - w and interpret the result.
5. Given the array A =[2,4,1 ; 6,7,2 ; 3,5,9], provide the commands needed to
a. assign the first row of A to a vector called x
b. assign the last 2 rows of A to an array called y
c. compute the sum over the columns of A
d. compute the sum over the rows of A
6. Given the arrays x =[1,4,8], y =[2,1,5] and A =[3,1,6 ; 5,2,7], determine which of the following
statements will correctly execute and provide the result. If the command will not correctly execute,
state why it will not.
a. x + y
b. x + A
c. x'+ y
d. A -[x' y']
e.[x ; y']
f. A -3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions