Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


inner product of two vectors
inner product of two vectors

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


Positive Infinity
Round the array a towards positive infinity

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Risolto


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

quasi 7 anni fa

Carica altro