Community Profile

Contact

Top 5% contributor

Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

Solve this!

3 years ago

There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

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]; and ...

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

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

Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

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

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

Regardless of input, output the string 'yes'.

Given the input n, return true if n is odd or false if n is even.

Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

4 years ago

Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

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

Load more