Community Profile

Contact

Top 1% contributor

The sum of the non-primes below 10 is 1+4+6+8+9+10=38 Find the sum of all the non-primes below the input, N.

Solve this!

2 years ago

Find the maximum value of a given vector or matrix.

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

3 years ago

*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

Given a matrix M, row vector v of appropriate length, and diagonal index d (where 0 indicates the main diagonal and off-diagonal...

Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

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

You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix and row and column, output the index of th...

Create n x 2n "mirror" matrix of this type: e.g. for n = 2 m = [1 2 2 1;1 2 2 1] e.g. for n = 3 m = [1 2 3 3 2 1...

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

Write a function that takes between 0.5 seconds and 0.6 seconds to run.

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

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

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

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

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

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

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

At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

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

Load more