Risolto


Create a vector of n alternating ones and zeros (★★)
Given n, your output should be a vector y of numbers such that the first number is 1 and the numbers following it alternate betw...

oltre un anno fa

Risolto


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...

oltre un anno fa

Risolto


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...

oltre un anno fa

Risolto


Variance computation (★★★)
Given a vector x with several values, compute the variance, whose formula is given by: <<https://i.imgur.com/Wg95KBE.gif>> ...

oltre un anno fa

Risolto


Reindex a vector (★★)
(copy of Prob. 676) You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX h...

oltre un anno fa

Risolto


Column Removal (★★★)
(copy of prob 7) Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2...

oltre un anno fa

Risolto


Vector raised to a power, element-wise (★)
Given a vector A and a number x, raise each element of the vector to the power of x. Thus, if A = [2 5 7 1] and x = 0.5, then ...

oltre un anno fa

Risolto


Variance computation (★)
Given a vector x with several values, compute the variance, whose formula is given by: <<https://i.imgur.com/Wg95KBE.gif>> ...

oltre un anno fa

Risolto


Create a vector of the first n odd numbers (★)
If n = 10, your program should return a vector y, where y = [1 3 5 7 9 11 13 15 17 19].

oltre un anno fa

Risolto


Average of corner elements of a matrix (★★)
(copy of prob 2235) Calculate the average of corner elements of a matrix. e.g. x=[1 2 3; 4 5 6; 7 8 9;] avg = (1+3+7+9)...

oltre un anno fa

Risolto


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...

oltre un anno fa

Risolto


Sum of elements of a vector (★★★)
Given any vector x = [x1, x2, x3, ... xn], compute the sum of its elements. Thus, if x = [ 1 3 -2 5 ], then the sum of its el...

oltre un anno fa

Risolto


Matrix convolution
A certain convolution step involves an elementwise multipication between two 3x3 matrices and taking the resulting sum of the el...

oltre un anno fa

Risolto


Create a vector of the first n natural numbers (★)
If n = 7, your program should return a vector y, where y = [1 2 3 4 5 6 7].

oltre un anno fa

Risolto


Convert Two Character String into a Binary Vector
Given a string "XOXXO" convert it into a binary vector. [1 0 1 1 0] Paul Berglund implemented an optimal method in <http://ww...

oltre un anno fa

Risolto


Evaluating continued fractions
Given row vector c=[c0 c1 c2 c3 ...] evaluate the continued fraction x=c0+1/(c1+1/(c2+1/(c3+...))) If c is a ...

oltre un anno fa

Risolto


Recursive triangle area
Given triangle 1 with sides of length a, b, and c. Triangle 2 is constructed within triangle 1 by bisecting each side. Triangl...

oltre un anno fa

Risolto


Find the largest sum of any contiguous subarray
Given an array of N integers, find the contiguous subarray (which must contain at least one number) with the maximum sum and ret...

oltre un anno fa

Risolto


Convert Kilometers to Miles
Convert kilometers to miles. Consider 1 km = 0.62 mile. Note: Don't use the '*' operator.

oltre un anno fa

Risolto


Sum the real and imaginary parts of a complex number
Sum the real and imaginary parts of a complex number. Example c = 1+2i has the solution 1 + 2 = 3

oltre un anno fa

Risolto


For a rectangle, if x is the length and 2x is width. Then find out x from the area of the rectangle?
For a rectangle, if x is the length and 2x is the width. Then find out x from the area of the rectangle? if the area is equal...

oltre un anno fa

Risolto


Pronounce digits
Given a number num, select the first d decimal places and pronounce the digits (in English). The function returns the pronunciat...

oltre un anno fa

Risolto


Get ranks of values in a vector
For a given vector, say [6 3 8 2], return the ranks (ascending) of observations, i.e. [3 2 4 1]. Do not worry about tied ranks. ...

oltre un anno fa

Risolto


Accurate Division
Given three integers x, y and d, return x/y (as a string) to d significant digits. Remove leading and trailing zeros. Example...

oltre un anno fa

Risolto


List the Moran numbers
The quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 ...

oltre un anno fa

Risolto


Valid Chess Moves
Using standard Algebraic notation ('' for a pawn), given previous move and a next move, output true if it is a valid move or fal...

oltre un anno fa

Risolto


Compress list
Given a non-empty list L of positif integers, compress the list so that only one occurrence is retained if two (or more) equal e...

oltre un anno fa

Risolto


Find the nearest value to the given one

oltre un anno fa

Risolto


Do you have the minimum age?

oltre un anno fa

Carica altro