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

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

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

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

7 months ago

Solved


function on a moving window
Create a function that applies an operation (such as @sum, @mean, @std, @norm etc) to a moving window of the data. First exampl...

7 months ago

Solved


Flexible Anonymous Function
Given a function handle, return a handle to a function that would accept an arbitrary number of inputs, applies the function to ...

7 months ago

Solved


Make an anonymous function that has variable output
Make a anonymous function that has variable output. f = @(x)... the following equation→equation(s) as followed has(ve) ...

7 months ago

Solved


Apply Function to Each Field of a Structure Array: Part 2
The builtin <http://www.mathworks.com/help/matlab/ref/structfun.html?=structfun structfun> applies a function handle to each fie...

7 months ago

Solved


Apply Function to Each Field of a Structure Array: Part 1
The builtin <http://www.mathworks.com/help/matlab/ref/structfun.html?=structfun structfun> applies a function handle to each fie...

7 months ago

Solved


Make a function that returns its own character count
Write a function that returns a 128 element vector with an accurate inventory of the ASCII characters in its own function file. ...

7 months ago

Solved


Matrix to 3-Column Matrix
Consider a matrix *A* such as A = [1 2 3 3 4 5 6; 2 3 4 5 6 7 8]; Can you convert this matrix to a three-column ...

7 months ago

Solved


Block average ignoring NaN values
Given a matrix, calculate the block average of each disjoint sub-matrix while ignoring *NaN* values. Assume that the size of the...

7 months ago

Solved


Block average
Given a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix alo...

7 months ago

Solved


Crunch that matrix!
You are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms ...

7 months ago

Solved


Moving Product (Easy)
Given an input array A, write a function *movprod(A,k,dim)* to calculate the moving product over a sliding window of length *k* ...

7 months ago

Solved


Fill the Matrix - 2
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the me...

7 months ago

Solved


Data Regularization
Provided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set *S* = [1,2,3,...,S] for any large in...

7 months ago

Solved


Simulate one complete step in the Biham–Middleton–Levine traffic model
The <http://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model Biham–Middleton–Levine traffic model> is ...

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

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

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

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

7 months ago

Solved


Spot the rectangle
This problem is related to the 17x17 challenge. Given a matrix filled with ones and zeros, determine whether or not any rectangl...

7 months ago

Solved


Spot the rectangle (Part 2)
This problem is related to the 17x17 challenge. See also Part 1 of this problem. Given a matrix in which each element is either ...

7 months ago

Solved


love is an n-letter word
Given a list of *N words*, return the *N-letter word* (choosing one letter from each word) with the property of having the least...

7 months ago

Solved


Cumulative maximum of an array
Find the cumulative maximum of an array without using the built-in function cummax (and a few others). Your function should act ...

7 months ago

Solved


Pattern Recognition 3 - Variable Unit and Array Length (including cell arrays)
You will be given various arrays, composed of numbers or strings, including cell arrays of strings. For this problem, the patter...

7 months ago

Solved


Cumulative minimum of an array
Find the cumulative minimum of an array without using the built-in function <http://www.mathworks.com/help/matlab/ref/cummin.htm...

7 months ago

Solved


Find the Final State of an Abelian Sandpile
Let us define an <http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile> as a matrix that is only...

7 months ago

Solved


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

7 months ago

Load more