Solved

Replicate elements in vectors

Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] ...

21 days ago

Solved

Generate N equally spaced intervals between -L and L

Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

22 days ago

Solved

intersection of matrices

Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

22 days ago

Solved

Return unique values without sorting

If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

22 days ago

Solved

Hexagonal numbers on a spiral matrix

Put hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements. Formula of hexagonal numbers ...

23 days ago

Solved

Find common elements in matrix rows

Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

24 days ago

Solved

Mandelbrot Numbers

The <http://en.wikipedia.org/wiki/Mandelbrot_set Mandelbrot Set> is built around a simple iterative equation. z(1) = c z...

24 days ago

Solved

Parse me a Lisp

*Description* In Lisp and its variants, function calls are done using parenthesis where the first item in the parenthesis is ...

29 days ago

Solved

Group-wise Euclidean distance

*Input*: * *x* —— An array of size *n-by-d*, where each row vector denotes a point in a d-dimensional space; * *g* —— A gro...

1 month ago

Solved

Integer sequence - 2 : Kolakoski sequence

Get the n-th term of <https://oeis.org/A000002 Kolakoski Sequence>.

1 month ago

Solved

Alternating sum

Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

1 month ago

Solved

Golomb's self-describing sequence (based on Euler 341)

The Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G...

1 month ago

Solved

"Look and say" sequence

What's the next number in this sequence? * [0] * [1 0] * [1 1 1 0] * [3 1 1 0] * [1 3 2 1 1 0] This a variant on the w...

1 month ago

Solved

GJam 2014 China Rd B: Sudoku Checker

This Challenge is derived from <http://code.google.com/codejam/contest/2929486/dashboard#s=p0 GJam 2014 China Sudoku>. Large Cas...

1 month ago

Solved

Sudoku square

We have a small Sudoku square, but one number is missing. x = [ 1 5 4 8 6 3 0 9 7 ] Make a function, wher...

1 month ago

Solved

Check to see if a Sudoku Puzzle is Solved

*Description:* Your task, should you choose to accept it, is to make a function that checks to see if a 9x9 matrix of integer...

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

1 month ago

Solved

Eight Queens Solution Checker

Write a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic <http://en.wikipe...

1 month ago

Submitted

Solver for nonlinear equation systems: newton.m

Solves a system f(x) = 0 with n equations in n variables.

1 month ago | 13 downloads |

Solved

Knight's Tour Checker

Given a matrix a, determine whether or not a legal <http://en.wikipedia.org/wiki/Knight's_tour knight's tour> is present. The kn...

3 months ago

Solved

Count letters occurence in text, specific to words with a given length.

Build a function with two input arguments: a string and a word length (number of letters), that outputs a vector of counts of th...

3 months ago

Solved

Data decompression

A chunk of data is to be 'decompressed'. Input: * compressed: a row vector of uint8 values. This is the compressed data. ...

3 months ago

Solved

letter yes yes & letter no no

Split a string into two strings, wherein the first string has all alphabetic letters and the second string has all the remaining...

3 months ago

Solved

QWERTY Shift Code Decoder

Decode a string encoded using the QWERTY shift code. QWERTY shift code is where the message was touch typed but with an offse...

3 months ago

Solved

QWERTY Shift Encoder

Encode a string using the QWERTY shift code. This code is where you touch type but are offset by one character to the right. ...

3 months ago

Solved

Under the sea: Snell's law & total internal reflection

<https://en.wikipedia.org/wiki/Snell's_law> When a light travels from one medium to another medium, depending on the refracti...

3 months ago

Solved

Find the sides of an isosceles triangle when given its area and height from its base to apex

Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

3 months ago

Solved

Regular polygon bounded by and bounding a circle

As the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area ...

3 months ago

Solved

Angle bisectors

Given 2 direction vectors, calculate the *_two_ (2) normalized angle bisectors* (which are perpendicular between them). Input...

3 months ago

Solved

Euclidean distance from a point to a polynomial

A not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point,...

3 months ago