Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


Back to basics - mean of corner elements of a matrix
Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

12 months ago

Solved


Sum of odd numbers in a matrix
Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


MatCAT - Reconstruct X from Its X-rays
Consider a matrix x x = [ 1 2 0 0 5 0 3 0 8 ] If we sum x along the rows we get row_sums = [3 5 11] ...

12 months ago

Solved


String Logic 8
Example: 'CAT' --> 65 'DOG' --> 68 'ROSY' --> 79 'MATLAB' --> 65 'TRUST' --> 82 'MOSTLY' --> 76

1 year ago

Solved


String Logic 5
Example: 'CAT' --> 'TAC' 'DOG' --> 'GOD' 'MATLAB' --> 'BALTAM' 'ROSY' --> 'YSOR' 'TRUST' --> 'TSURT' 'MOSTLY' --> 'YLTS...

1 year ago

Solved


Remove Lower Case Letters
Example MEMOry --> MEMO IMPlEMeNtATiON --> IMPEMNATON

1 year ago

Solved


Remove Upper Case Letters
Example Matlab --> atlab proBlem --> prolem Enter --> nter

1 year ago

Solved


String Logic 2
Example: ROSY --> HEIO TRUST --> JHKIJ MOSTLY --> CEIJBO

1 year ago

Solved


String Logic 14
Examples: 'DIG' --> 'HRN' 'KIMBALL' --> 'VRZDBXX' 'DEAL' --> 'HJBX' 'LIMB' --> 'XRZD' 'MADE' --> 'ZBHJ' 'CHEF' --> 'FPJL'

1 year ago

Solved


String Logic 6
Examples: 'CAT' --> 216 'DOG' --> 218 'ROSY' --> 333 'MATLAB' --> 433 'TRUST' --> 418 'MOSTLY' --> 488

1 year ago

Solved


Compute a sum of Ramanujan
Srinivasa Ramanujan defined the following function: Write a function to compute for various values of . See also Cody Proble...

1 year ago

Load more