Solved


Repeat middle rows and columns of an array
Given an MxN numeric array (A), return an array (B) in which the middle rows and columns have each been repeated once. It may be...

7 years ago

Solved


Change a specific color in an image
The ability to change colors can be a useful tool in image processing. Given an m x n x 3 array (much like CData in images), fin...

7 years ago

Solved


Tribute to Ramanujan
The nth taxicab number, denoted as T(n), is defined as the smallest number that can be expressed as a sum of two positive algebr...

7 years ago

Solved


Path of least resistance - Move all direction
Extension of the wonderful <https://www.mathworks.com/matlabcentral/cody/problems/1049-path-of-least-resistance Problem 1049> (P...

7 years ago

Solved


Graph Algorithms 3: Number of Connected Components
Given an adjacency matrix of a simple undirected graph, find the number of connected components.

7 years ago

Solved


Construct a precedence graph from a code segment
A hypothetical MATLAB code segment containing n lines is given in the form of a cell array. The i-th cell contains the i-th line...

7 years ago

Solved


Signal Processing Basic - 1. Stretch a signal
Input vector V is a discrete time signal assuming the first sample is sampled at t=0. This signal has to be stretched in time. ...

7 years ago

Solved


Integer Sequence - 1
Check the test suite to determine the relationship between input integer scalar and output integer scalar.

7 years ago

Solved


Calculate the h-index
H-index is a powerful tool for quantifying the scientific contribution of a researcher. H-index is defined as follows (source - ...

7 years ago

Solved


all possible subsets of set
Given a vector, return all possible subsets of the vector in a cell array. Properties of basic set theory is assumed to be valid...

7 years ago

Solved


BLOCK x3 (Version 2)
An extension to problem 2451 ( <https://www.mathworks.com/matlabcentral/cody/problems/2451-block-x3-version-1> ). It is based...

7 years ago

Solved


grazing cows
Here is a fun problem I encountered in high school. Two cows are grazing in an enclosed square-shaped field of side length s ...

7 years ago

Solved


Determine connected components of a graph
Adjacency matrix of an undirected graph is given. Return the number of connected components in the graph.

7 years ago

Solved


FIFA World Cup 2014 : Offside
This problem is about offside rule in football (soccer). Input is a matrix with mostly zeros and a few 1, 2, 3 and 4s. A zer...

7 years ago

Solved


Graph Algorithms - 1 : Length of the largest closed path
An undirected simple graph is given as the form of an adjacency matrix. Find the length of the largest closed path (one that sta...

7 years ago

Solved


birthday on same day of week
Say, Mr. X's birthday is on 20th July, 2014. It was Sunday. Determine the closest year when his birthday will again be on Sunday...

7 years ago

Solved


Let's see how peculiar we can get
The task is to multiply two numbers. But do it in the most peculiar possible way.

7 years ago

Solved


I want eval
A valid MATLAB statement containing a definition of a vector is passed as a string S. Determine the length of the vector. Inp...

7 years ago

Solved


row-th maximum row elements
Input a is a square matrix of size n*n. Output vector v is of size 1*n. The ith element of output v is the ith largest element o...

7 years ago

Solved


Graph Algorithms - 2 : Chromatic Number
Chromatic number of a graph is the minimum number of distinct colors required to color all the vertices of the graph such that n...

7 years ago

Solved


weekday and month
Given a year and a weekday, determine how many months of that year had five of those weekdays. It is kind of easy to find. Ex...

7 years ago

Solved


Create Combination
Motivation: In many problems, we need to create combinations with the function nchoosek. In some cases, however, choices are lim...

7 years ago

Solved


Trickier Timing
You solution should return control to main program only when the current time ends in either a 5 or 0 (e.g. the current seconds ...

7 years ago

Solved


Convert Hard Drive marketing sizes to actual data sizes
Hard drive sizes are typically marketed using the decimal meaning of prefixes, whereas RAM uses binary meanings. For example: ...

7 years ago

Solved


Square wave average calculation
Given its peak and duty cycle, calculate avg value of square wave

7 years ago

Solved


Concatenate matrix into 4 quadrants for given number of iteration
If given a matrix and number, output should be its concatenation like wavelet for given number of iterations. Example a ...

7 years ago

Solved


Calculate the peak value of square wave
Given the peak value of sine wave, calculate corresponding peak value of square wave, if both have same RMS voltage.

7 years ago

Solved


calculate RMS voltage
given peak to peak voltage, calculate rms voltage

7 years ago

Solved


Polynomial division
Divide a polynomial u by polynomial v and return the quotients only. Example: u = x^4+3*x^3+5*x+3 v = x^2+1 Answer: ...

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

7 years ago

Load more