Solved

Convert matrix to 3D array of triangular matrices

Given a 2D numeric array x in which each column represents the vectorized form of an upper triangular matrix, return a 3D array ...

3 years ago

Solved

Hankelize a matrix

Similar to <http://www.mathworks.com/matlabcentral/cody/problems/42501-toeplitize-a-matrix Problem 42501. Toeplitize a matrix>, ...

3 years ago

Solved

Toeplitize a matrix

Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

3 years ago

Solved

matrix zigzag

Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

3 years ago

Solved

Matrix of Multiplication Facts

This is James's daughter again, sneaking into his Cody account. Thanks to your help in my math class last year, I did great! B...

3 years ago

Solved

Some Assembly Required

The input to this function is a matrix of real numbers. Your job is to assemble the rows of the matrix into one large row that ...

3 years ago

Solved

Polite numbers. Politeness.

A polite number is an integer that sums of two or more consecutive positive integers. Politeness of a positive integer is a num...

3 years ago

Solved

Generate a Parasitic Number

This problem is the next step up from <http://www.mathworks.com/matlabcentral/cody/problems/156-parasitic-numbers Problem 156>. ...

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

3 years ago

Solved

Give me Hamming on five, hold the mayo

A Hamming Number is a positive number that has no prime factor greater than 5. Given a number X, determine how many Hamming num...

3 years ago

Solved

nth Rational Number

Return the nth rational number. This is the inverse to Problem <http://www.mathworks.com/matlabcentral/cody/problems/1471 1...

3 years ago

Solved

Twist 'n' Match

Given n and m, construct an n-by-n matrix a such that a, when rotated 90 degrees and compared with itself, matches itself in exa...

3 years ago

Solved

Mirror Image matrix across anti-diagonal

Given an input number x, create a mirror image matrix 'Y' across the anti-diagonal. For example, if x=3, Y = [1 2 3; ...

3 years ago

Solved

Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.

For example, if n=2 (maximum value), the output matrix should be [1 1 1 1 1; 1 2 2 2 1; 1 2 1 2 1; 1 2 2 2 1; 1...

3 years ago

Solved

Create a matrix X, where each column is a shifted copy of the vector v

Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

3 years ago

Solved

Create a patchwork matrix

This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

3 years ago

Solved

Matrix spiral

Make a spiral in a (n*n) matrix. The spiral has to start in the top left, and has to rotate clockwise to the center. The spiral ...

3 years ago

Solved

Spiral In

Create an m by n matrix filled with sequential integers starting from 1 and arranged in a counterclockwise spiral that hugs the ...

3 years ago

Solved

Spot the rectangle (Part 2)

This problem is related to the <http://bit-player.org/2009/the-17x17-challenge 17x17 challenge>. See also <http://www.mathworks....

3 years ago

Solved

Make a logical diamond using GALLERY function

Inspired from <http://www.mathworks.com/matlabcentral/cody/problems/1078-make-a-diamond Problem 1078. Make a diamond> In thi...

3 years ago

Solved

Spot the rectangle

This problem is related to the <http://bit-player.org/2009/the-17x17-challenge 17x17 challenge>. Given a matrix filled with ones...

3 years ago

Solved

Pascal's Matrix

Given an integer n ≥ 0, generate the ( _n_+1) × ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...

3 years ago

Solved

Pascal's pyramid

In Pascal's triangle each number is the sum of the two nearest numbers in the line above: 1 1 1 ...

3 years ago

Solved

Triangular matrices in 3D array

Given a 3D numeric array _x_, return an array _y_ of the same size in which all entries to the right of the main diagonal are ze...

3 years ago

Solved

Toeplitz Matrix

For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

3 years ago

Solved

ZigZag matrix with reflected format

ZigZag MATRIX with REFLECTED format. We have only input x. We have to create a matrix in the following pattern. input n=5...

3 years ago

Solved

Create a block diagonal matrix

A block diagonal matrix is a square matrix that can be written as A = [a 0 0 0 0 b 0 0 0 0 c 0 ...

3 years ago

Solved

BULLSEYE Part 2: Reference Problem 18 BULLSEYE

Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples: Input ...

3 years ago

Solved

Calendar Matrix

Return a calendar matrix for the given values of month and year. Assume that Sunday is the first day of the week. The resulting ...

3 years ago

Solved

Diagonal of a Spiral Matrix

Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...

3 years ago