已解决


Index one element in each vector of an array along a given dimension
Functions like min and max can return in their second output argument the index of the element in each vector along a particular...

8 years 前

已解决


expand intervals vol.3
This is the next problem after <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528> and <http://www.mathworks.co.u...

8 years 前

已解决


expand intervals vol.2
Similar to problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528>. This is a more general case, when bounds ...

8 years 前

已解决


expand intervals
You're given a row vector of an even number of monotonically increasing integers. Each pair of consecutive integers is the lower...

8 years 前

已解决


compress sequence into intervals
You're given a row vector of monotonically increasing integers most of which are consecutive. Find the upper and lower bounds of...

8 years 前

已解决


return row and column indices given 2 values which define a range
Inspired by problem <http://www.mathworks.co.kr/matlabcentral/cody/problems/856-getting-the-indices-from-a-matrice> Inputs: - ...

8 years 前

已解决


Finding neighbors of [-1:1] in a matrix....
Hello All! Well I found this one fun to figure out, all you have to do is make a matrix of 1's or 0's (true or false) that sh...

8 years 前

已解决


Index of a Rational number
The set of real numbers are infinite. They are so many that real numbers can't even be enumerated. However, unlike real numbers ...

8 years 前

已解决


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

8 years 前

已解决


Three...is a magic number.
Yes it is... It's a magic number... To help you get rid of that earworm, here's a new Cody problem. You are given a squar...

8 years 前

已解决


Max Change in Consecutive Elements
If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

8 years 前

已解决


Replace pattern 0 1 0 and 1 0 1
Find and replace a pattern in a row of zeroes and ones. * Find 1 0 1 and replace it with 1 1 1 * Find 0 1 0 and replace it w...

8 years 前

已解决


counting groups!
This problem is about counting groups. Example If you have x: x = [0.8 0.8 0.8 0.3 0.3 0.4 0.5 0.6 0.6 0.9] then a...

8 years 前

已解决


Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix. Example ...

8 years 前

已解决


Another colon problem
This is simple problem based on problems 555, 801, 1118, etc. Create an index vector from two input vectors. Example: ...

8 years 前

已解决


Time Expansion
How can you slow down any discrete-time signal? Example Input original signal x. x = [1 2 3 -1 -2 -5 -4] We want t...

8 years 前

已解决


Sort numbers by outside digits
Sort the array so that they are sorted as if their value was a 5 digit number made from the first three and last two digits of t...

8 years 前

已解决


Find the maximum two numbers of every column of a matrix
Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

8 years 前

已解决


How unique?
Sometimes, when we check unique entries of vector we would like to know how many times each value occurs. Given vector of num...

8 years 前

已解决


Find the index of n in magic(n)
If input n=5, then magic(n) is 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22...

8 years 前

已解决


Rotate and display numbered tile
Imagine a square tile with four numbers on it, one on each edge. We will call these edges north, east, south, and west. If th...

8 years 前

已解决


Decimation - Optimized for speed
This problem is similar to http://www.mathworks.com/matlabcentral/cody/problems/1092-decimation, only this time the score will b...

8 years 前

已解决


Decimation
When dealing to the Roman Army, the term decimate meant that the entire unit would be broken up into groups of ten soldiers, and...

8 years 前

已解决


Implement a bubble sort technique and output the number of swaps required
A bubble sort technique compares adjacent items and swaps them if they are in the wrong order. This is done recursively until al...

8 years 前

已解决


Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
For a row vector: V=[7 1 2 -3] there is one sign change (from 2 to -3). So, the function you write must return N=1. F...

8 years 前

已解决


Set a diagonal
Given a matrix M, row vector v of appropriate length, and diagonal index d (where 0 indicates the main diagonal and off-diagonal...

8 years 前

已解决


Reference Index Number
Given a reference set R of elements (each unique but identical in type), and a list V of elements drawn from the set R, possibly...

8 years 前

已解决


Unique values without using UNIQUE function
You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

8 years 前

已解决


Create an n-by-n null matrix and fill with ones certain positions
The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

8 years 前

已解决


Oh Zero Zero Zero!!!
Hello all, So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...

8 years 前

加载更多