해결됨


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

3년 이상 전

해결됨


sum of first 'n' terms
Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

3년 이상 전

해결됨


Is my wife right?
Regardless of input, output the string 'yes'.

3년 이상 전

해결됨


Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

3년 이상 전

해결됨


inner product of two vectors
inner product of two vectors

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

3년 이상 전

해결됨


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

3년 이상 전

해결됨


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

3년 이상 전

해결됨


Making change
Given an amount of currency, return a vector of this form: [100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01] Example: Input a = ...

3년 이상 전

해결됨


Elapsed Time
Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


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

3년 이상 전

해결됨


Positive Infinity
Round the array a towards positive infinity

3년 이상 전

해결됨


Twins in a Window
<http://en.wikipedia.org/wiki/Twin_primes Twin primes> are prime numbers that differ by 2, such as [11,13] or [41,43]. Write a f...

3년 이상 전

해결됨


Number of toolboxes?
Return a number equal to the number of toolboxes available to the Cody solvers.

3년 이상 전

해결됨


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

3년 이상 전

해결됨


Make a Palindrome Number
Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...

3년 이상 전

해결됨


Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

3년 이상 전

해결됨


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

3년 이상 전

해결됨


surface of a spherical planet
you just discovered its circumference, that is the input.

3년 이상 전

Load more