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...
2年弱 前
解決済み
Create times-tables (★★★)
(copy of prob 33)
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 ti...
Vector of digits (★★)
Given a positive integer x, construct a vector y with all the digits of x in the order of appearance in x. Thus, if
x = 172...
2年弱 前
解決済み
Matrix Indexing
Given a matrix A and scalars r,c,i, find the product of two elements, with the first element located at row r and column c (doub...
2年弱 前
解決済み
Variance computation (★)
Given a vector x with several values, compute the variance, whose formula is given by:
<<https://i.imgur.com/Wg95KBE.gif>>
...
2年弱 前
解決済み
Replicate elements in vectors (★★★)
(copy of Prob 867)
Replicate each element of a row vector (with NaN) a constant number of times. Examples
n=2, A=[1 2...
2年弱 前
解決済み
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...
Approximate functions 1 (★★★)
Compute the following sum for any given x and positive integer n.
<<https://i.imgur.com/eUwXdSE.gif>>
<>
Here m! denote...
2年弱 前
解決済み
Sum of terms in a series 1 (★★★)
Given x and n, compute the following sum:
|x|+|x|^(1/2)+|x|^(1/3)+|x|^(1/4)+|x|^(1/5) ... + |x|^(1/n)
where ||x|| indica...
2年弱 前
解決済み
Function 1 (★)
Compute the value of
<<https://i.imgur.com/AxKWLmE.gif>>
for any given positive x.