Stacking vectors into a matrix
Given a 4x1 vector a, and a 2x2 matrix b, create a matrix M in which the first 2 rows are each identical to a and the last two r...
Element-wise vector product (★)
Given two vectors x and y, compute their element-wise product z.
Thus, if x = [1 3 5] and y = [0.5 -1 2], then
z = [1*0.5...
Doubling elements in a vector (★★)
(copy of prob. 1024)
Given the vector A, return B in which all numbers in A are doubling. So for:
A = [ 1 5 8 ]
t...
3年以上 前
解決済み
PEMDAS test (★★)
Create the function that will return the following expression for x and y.
<<https://i.ibb.co/RHWyzrv/Code-Cogs-Eqn-1.gif>>
...
3年以上 前
解決済み
Swap the first and last columns (★★)
(copy of Prob 19)
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becom...
Variance computation (★)
Given a vector x with several values, compute the variance, whose formula is given by:
<<https://i.imgur.com/Wg95KBE.gif>>
...
3年以上 前
解決済み
Sum the rows
Sum the rows of the given matrix.
Example
x = [ 1 2
3 4 ]
y = [ 3
7 ]