Community Profile

Contact

Top 1% contributor

Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

Solve this!

3 years ago

Given a vector of lengths [a b c], determines whether a triangle with non-zero area (in two-dimensional Euclidean space, smarty!...

*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

Return an array of numbers which (effectively) count from 0 to N^M-1 in base N. The result should be returned in a matrix, with ...

Given a vector v of integers and an integer n, return the the indices of v (as a row vector in ascending order) that sum to n. I...

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]

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

Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

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

Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

you just measured its surface area, that is the input.

Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

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

Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

<http://en.wikipedia.org/wiki/Benford%27s_law Benford's Law> states that the distribution of leading digits is not random. This...

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

Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

inner product of two vectors

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

Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...

Load more