已解决


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

3 months 前

已解决


Check if number exists in vector
Return 1 if number a exists in vector b otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,2,3]; Returns 1.

3 months 前

已解决


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

3 months 前

已解决


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

3 months 前

已解决


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

3 months 前

已解决


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

3 months 前

已解决


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

3 months 前

已解决


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displayed ...

3 months 前

已解决


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2 3 3 3 4...

3 months 前

已解决


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false. Example...

3 months 前

已解决


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

3 months 前

已解决


Find the next prime number
Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

3 months 前

已解决


Make a vector of prime numbers
Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

3 months 前

已解决


Largest Twin Primes
<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

3 months 前

已解决


Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

3 months 前

已解决


Find nearest prime number less than input number
Find nearest prime number less than input number. For example: if the input number is 125, then the nearest prime number whi...

3 months 前

已解决


Sophie Germain prime
In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

3 months 前

已解决


Mersenne Primes vs. All Primes
A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

3 months 前

已解决


The Goldbach Conjecture
The Goldbach conjecture asserts that every even integer greater than 2 can be expressed as the sum of two primes. Given the eve...

3 months 前

已解决


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

3 months 前

已解决


Get all prime factors
List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...

3 months 前

已解决


Proper Factors
Generate the proper factors of input integer x and return them in ascending order. For more information on proper factors, refer...

3 months 前

已解决


Multiples of a Number in a Given Range
Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

3 months 前

已解决


Smith numbers
Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at http://en.wikipedia...

3 months 前

已解决


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

3 months 前

已解决


Convert radians to degrees
Given input in radians, output to degrees

3 months 前

已解决


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

3 months 前

已解决


Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

3 months 前

已解决


Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given number of...

3 months 前

已解决


radius of a spherical planet
You just measured its surface area, that is the input.

3 months 前

加载更多