Solved


Count from 0 to N^M in base N.
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 ...

14 years ago

Solved


Find best domino orientation
Given a list of pairs, find the orientation they should be placed in a line, such that the sum of the absolute values of the dif...

14 years ago

Solved


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

14 years ago

Solved


Back to basics 24 - Symbolic variables
Covering some basic topics I haven't seen elsewhere on Cody. Given a string algebraic expression, return the symbolic variabl...

14 years ago

Solved


Poker Series 01: isStraightFlush
The Poker Series consists of many short, well defined functions that when combined will lead to complex behavior. Our goal is t...

14 years ago

Solved


Decode a simplified barcode
Given a bar code from this <http://www.mathworks.com/matlabcentral/cody/problems/602-make-a-simplified-bar-code exercise>: Re...

14 years ago

Solved


Make a simplified barcode
Given an integer to encode, make a barcode using the following encoding scheme: * The bar code is made from the binary versio...

14 years ago

Solved


How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

14 years ago

Solved


Sum the entries of each column of a matrix which satisfy a logical condition.
Given a numeric matrix A and a logical array L of the same size as A, return a row vector S containing the columnwise sums of th...

14 years ago

Solved


Vectorizing, too easy or too hard?
Please insert a . before any ^, * or / in the string. That's it!!

14 years ago

Solved


commutative?
Given the handle to a binary function that takes two ordinary numbers, test if the function is commutative.

14 years ago

Solved


Leaking?
Graham's law states that the rate of effusion of a gas is inversely proportional to the square root of its molecular weight. A b...

14 years ago

Solved


bad colorimeter?
You have tested one good and one bad colorimeters with a colored solution at two path lengths of light and recorded transmittanc...

14 years ago

Solved


DC chopper
Input x is the sampled signal vector, may have both AC and DC components. output vector y should have AC components removed then...

14 years ago

Solved


Least common multiple of many numbers
1:6 -> 60

14 years ago

Solved


magic solver
Create a function that returns _true_ and has a cody <http://www.mathworks.com/matlabcentral/cody/problems/256-return-the-size-o...

14 years ago

Solved


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

14 years ago

Solved


Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...

14 years ago

Problem


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

14 years ago | 10 | 437 solvers

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

14 years ago

Solved


System of equations
Find a solution to a system of equations represented by a |n| by |n+1| matrix. For instance, [ 2 0 4; => 2*x = 4 ...

14 years ago

Solved


Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...

14 years ago

Solved


Wind outward from the center ...
Create an n-by-n matrix with elements ranging from 1 to n^2 in a rectangular spiral pattern. Example if n = 5 : 21 ...

14 years ago

Solved


Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

14 years ago

Solved


Column norms of a matrix
Given a matrix M, return a vector y such that for each k y(k)=norm(M(:,k)) (y(k) is the Euclidean norm of the k-th col...

14 years ago

Solved


Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

14 years ago

Solved


Remove NaNs and numbers adjacent to NaNs
The aim is to remove the elements before and after NaN occurrences inside a vector. For example: x = [6 10 5 8 9 NaN 23 1...

14 years ago

Solved


Covering area
As an extension of the problem <http://www.mathworks.com/matlabcentral/cody/problems/416-polygon-area>, find the area, bounded b...

14 years ago

Solved


Find number of days
The input is two date in string format (dd-mm-yyyy) find out the number of days between these two dates. Example: input: ...

14 years ago

Solved


Implement a counter
Write a function that returns a function that counts the number of times it is invoked. Example: >> h = counter; >> h() ...

14 years ago

Load more