Gelöst


Get the mean digit
Write a function that gives the mean digit (round towards nearest integer) of an input and positive number. For example: x ...

mehr als 5 Jahre vor

Gelöst


Alternate list of elements
Write a function that combines two lists by alternating the elements, e.g. ['a','b','c'], ['1','2','3'] → 'a1b2c3'.

mehr als 5 Jahre vor

Gelöst


Snakes on a plane
Given the dimensions of a 2-d plane, create a matrix where a "snake" of ones occupies the plane from top left to bottom right. ...

mehr als 5 Jahre vor

Gelöst


Make an awesome ramp for a tiny motorcycle stuntman
Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

mehr als 5 Jahre vor

Gelöst


Pluralization
Define function plu(n) that returns '' (an empty string) if n=1, or 's' otherwise. This is handy for displaying messages from a...

mehr als 5 Jahre vor

Gelöst


Mean ignoring NaNs
Define a function that behaves in the same way as mean(x) and mean(x,d) except that it ignores NaNs (unless all of the values be...

mehr als 5 Jahre vor

Gelöst


Ordinal numbers
Given an integer n, return the corresponding ordinal number as a character string. For example, ord(1)='1st' ord(2)=...

mehr als 5 Jahre vor

Gelöst


Compute the perimeter of an ellipse
While the area of an ellipse is straightforward to compute, the perimeter (or circumference) is more complicated. The perimeter ...

mehr als 5 Jahre vor

Gelöst


Without the French accent please!
Suppress the French accent. Example 'Déjà présent' -> 'Deja present'

mehr als 5 Jahre vor

Gelöst


Ratio between sums of prime and non-prime numbers
Write a function that calculates the ratio between the sum of the prime numbers lower or equal than x, and the sum of the non-pr...

mehr als 5 Jahre vor

Gelöst


Ratio between sum of primes and sum of factors
Write a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of ...

mehr als 5 Jahre vor

Gelöst


Check if is a square
Given four coordinates, write a function to check if they form a square on the XY plane.

mehr als 5 Jahre vor

Gelöst


Ackermann's Function
Ackermann's Function is a recursive function that is not 'primitive recursive.' <http://en.wikipedia.org/wiki/Ackermann_fun...

mehr als 5 Jahre vor

Gelöst


Get the area of ​​the square.
Four circles are inscribed in the square ABCD. The perimeter of each circle is *aπ*. <<http://imgfz.com/i/UzgCJut.png>> Gi...

mehr als 5 Jahre vor

Gelöst


Find max prime number
Given integer number n. Find the max prime number (mpn) that smaller than or equal to n. Example: n = 10 --> mpn = 7

mehr als 5 Jahre vor

Gelöst


Finding sum of even numbers in a vector.
Find the sum of all the even numbers present in the input vector x. Examples: Input x = [1 2 3 4] Output y is 6 Input...

mehr als 5 Jahre vor

Gelöst


How many monitors are connected ?
How to obtain the numbers of monitors connected to your computer ?

mehr als 5 Jahre vor

Gelöst


Number of divisors of a given number
Given a Number n, return the number of his divisors without listing them example: n=14 ; Divisors={1,7,2,14} ; y=4 n=...

mehr als 5 Jahre vor

Gelöst


Wind outward from the center ...
Create an n-by-n matrix with elements ranging from 1 to n^2 in a rectangular spiral pattern. Example if n = 5 : 21 ...

mehr als 5 Jahre vor

Gelöst


Reepeating numbers in array
Repeating numbers in array In = [1 0 0 0 2 0 0 0 3 0 0 0 0 0 5 0 0 0 0]. Out = [1 1 1 1 2 2 2 2 3 3 3 3 3 3 5 5 5 5 5].

mehr als 5 Jahre vor

Gelöst


Is there a GPU Device?
Return true if there is a supported GPU device available on the Cody computer.

mehr als 5 Jahre vor

Gelöst


Make visible max values
Make visible maximum values of rows input = [1 2 3 4 5; 6 9 8 2 1; 2 1 4 5 8; 1 9 7 9 2]; ...

mehr als 5 Jahre vor

Gelöst


Homemade: Control Charts
This problem is a simple version of control charts in statistics. Intput consists from 30 or more observations. * Upper limi...

mehr als 5 Jahre vor

Gelöst


Power of n ?
Determine if _x_ (positive integer) is a power of _n_, return true or false accordingly.

mehr als 5 Jahre vor

Gelöst


Sum Rows
Sum the same indexed (unique) rows. Examine the test suite. Related Challenge - <http://www.mathworks.com/matlabcentral/cody/...

mehr als 5 Jahre vor

Gelöst


Find the biggest digit in a matrix
Write a function to find the biggest digit in a matrix; input -> a matrix output -> a digit For example; [12; 47;...

mehr als 5 Jahre vor

Gelöst


Encode Roman Numerals
Create a function taking a non-negative integer as its parameter and returning a string containing the Roman Numeral representat...

mehr als 5 Jahre vor

Gelöst


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

mehr als 5 Jahre vor

Gelöst


Double Factorial
Return double factorial n(n-2)...(5)(3)(1), n>0, odd n!! = n(n-2)...(6)(4)(2), n>0, even 1 ...

mehr als 5 Jahre vor

Mehr laden