Solved

Longest run of consecutive numbers

Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

2 years ago

Solved

Hard limit function

Classify x data as if x>=0 then y=1 if x<0 then y=0 Example x = [ -2 -1 0 1 2] y = [ 0 0 1 1 1]

2 years ago

Solved

Find Elements in Range

Based on a question on <http://www.mathworks.com/matlabcentral/answers/ MATLAB Answers>. Find all the elements of a vector wh...

2 years ago

Solved

Find the two most distant points

Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

2 years ago

Solved

Make a Palindrome Number

Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...

2 years ago

Problem

Prime Product

My professor has given a sequence of N numbers as a1, a2, ..., aN and asked me to find the smallest possible value of ai * aj su...

2 years ago | 1 | 28 solvers

Solved

Back to basics 11 - Max Integer

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

2 years ago

Solved

Back to basics 8 - Matrix Diagonals

Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

2 years ago

Solved

Solve the Sudoku Row

*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

2 years ago

Solved

Back to basics 6 - Column Vector

Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

2 years ago

Solved

Convert a vector into a number

This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

2 years ago

Solved

04 - Scalar Equations 3

Define the variables a, b, and c: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> <<http://samle.dk/STTBDP/Assignment1_4-b....

2 years ago

Solved

Make one big string out of two smaller strings

If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

2 years ago

Solved

Sum my indices

Given inputs M and N (in that order), output an MxN matrix whose entries are equal to the sum of their indices. Example input...

2 years ago

Solved

Mongean Shuffle

A Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side. * The top card of the deck is...

2 years ago

Solved

Minefield Sonar

*Background* In mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left c...

2 years ago

Solved

Geometry: Find Circle given 3 Non-Colinear Points

*This Challenge is to determine the center and radius of a circle given three non-colinear points.* *Input:* Points *Outpu...

2 years ago

Solved

Volume of a Simplex

Return the volume of a <http://en.wikipedia.org/wiki/Simplex regular _n_-simplex> with a unit side length. Results are up to...

2 years ago

Solved

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

2 years ago

Solved

Index of a Rational number

The set of real numbers are infinite. They are so many that real numbers can't even be enumerated. However, unlike real numbers ...

2 years ago

Solved

Generalised Hamming Number

Inspired by Project Euler n°204 and Problem 1308 by James A generalised Hamming number of type n, has no prime factor larger ...

2 years ago

Solved

Recaman Sequence - II

Take an arbitrary starting point as input and create Recaman Sequence. Then find the 1, return its index. For example: if n =...

2 years ago

Solved

Big numbers, repeated least significant digits

This problem builds off of <http://www.mathworks.com/matlabcentral/cody/problems/3077-big-numbers-least-significant-digits/ Prob...

2 years ago

Solved

Big numbers, least significant digits

Given two numbers, x and n, return the last d digits of the number that is calculated by x^n. In all cases, d will be the number...

2 years ago

Solved

Return a list sorted by number of occurrences

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

2 years ago

Solved

Pangrams!

A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

2 years ago

Solved

Pascal's Triangle

Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

2 years ago

Solved

Happy 2013...

Happy 2013, everyone! An interesting tidbit about 2013 is that it is the first year since 1987 to contain four different digits...

2 years ago

Solved

P-smooth numbers

This Challenge is to find <https://en.wikipedia.org/wiki/Smooth_number P-smooth number> partial sets given P and a max series va...

2 years ago