已解决


Operate on matrices of unequal, yet similar, size
You may want to add a vector to a matrix, implying that the vector is added to each column of the matrix. Or multiply a 3x4x5 ma...

6 years 前

已解决


Removing rows from a matrix is easy - but what about inserting rows?
Assume A is a 5-by-5 matrix. A([2,4],:) = [] is a quick way to remove rows 2 and 4. Can you find a quick way to insert rows into...

6 years 前

已解决


pizza deals
Given two pizza slices of different sizes: * Slice A with angle alpha1, radius r1, and price p1 * Slice B with angle alpha2,...

6 years 前

已解决


Rotate Matrix Clockwise (45 Degree)
*Matrix (3x3 only) rotation clockwise*: 2 inputs: *x* matrix and *n* times. output: *y* matrix with *n x 45* degree ro...

6 years 前

已解决


Insert certain elements into a vector.
We start with vector V. Some values W will be inserted into V, at positions U. Say, |V| contains |[1 2 3 4 5]| and |W| is |[0...

6 years 前

已解决


N-Dimensional Array Slice
Given an N-dimensional array, _A_, an index, _I_, and a dimension, _d_, return the _I_ th elements of _A_ in the _d_ dimension. ...

6 years 前

已解决


Find parts of a circle.
Given radius (r) of a circle find the diameter (d), circumference (c), an area (a).

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

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

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

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

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

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

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

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

6 years 前

已解决


Largest territory
Determine whose territory is largest. If there are multiple numbers tied for the largest territory, return the smallest number. ...

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

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

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

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

6 years 前

已解决


Vector to 3-Column Matrix
Consider a vector *A* such as A = [1 2 3 3 4 5 6] Can you convert this vector to a three-column matrix like this: ...

6 years 前

已解决


Sort rows of a matrix
Sort rows of matrix A in an ascending order according to the last column Example input: A = [1 2 3;7 8 9;4 5 6]; Exam...

6 years 前

已解决


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

6 years 前

已解决


Replace secondary diagonal elements of a square array
Replace all the secondary diagonal elements of the square array A with the number n Example: A = [1 2 3 4 5 6 ...

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

6 years 前

已解决


Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

6 years 前

已解决


Find the same and successive values in a vector
Find the same and successive values in a vector. For example: Input x = [ 1 0 0 1 1 1 1 0 1 1 1 0 0 0 1 ] Start and end...

6 years 前

已解决


Find Elements in Range
Based on a question on <http://www.mathworks.com/matlabcentral/answers/ MATLAB Answers>. Find all the elements of a vector wh...

6 years 前

已解决


longest sequence of nans
In an array return the length of longest sequence of nans for each column. x = [ 2 3 1 2 5 6; nan nan 5 n...

6 years 前

已解决


Split array into pieces according to corresponding array
An array x of length n has values 1...m with each value appearing at least once. The values are sorted (n>=m). A second...

6 years 前

加载更多