Solved


Repeat elements of a vector
Repeat each elements of a given vector according to their values. * x=[1,2,1,3] * y=[1,2,2,1,3,3,3]

6 years ago

Solved


Create incremental spiral WITHOUT USING EVAL or FEVAL
Constructions that use feval or eval are used to cheat with cody. This test-suite tries to avoid that trick. The goal of this...

6 years ago

Solved


The End of the World
given a date -- represent it in the Maya long count system. <https://en.wikipedia.org/wiki/Maya_calendar> <https://maya.nm...

6 years ago

Solved


Summing Rows and Columns
Create a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last...

6 years ago

Solved


generate the matrix
given a value n (say 4) - generate the matrix like below y= [0 1 2 3 4; -1 0 1 2 ...

6 years ago

Solved


Square
square root of x

6 years ago

Solved


factorial
calculate x!

6 years ago

Solved


Last non-zero digit
Given a number n, find the last non-zero digit of the factorial of that number. You need to take care of the large values of n....

6 years ago

Solved


Sum Sum Sum!
Calculate the sum of the natural numbers from 1 to n

6 years ago

Solved


Singular Value Decomposition
Calculate the three matrices of the singular value decomposition (A = U*S*V^T) for each provided matrix. U and V are square unit...

6 years ago

Solved


Don't Try, give up and return NaN.
This is another version of <http://www.mathworks.com/matlabcentral/cody/problems/3107-try-and-catch-simple-example problem 3107....

6 years ago

Solved


Calculate days until Christmas
Provided with inputs year, month, day e.g. 2019,11,12, calculate the number of days until the next Christmas day, i.e. the next ...

6 years ago

Solved


Check if a number belongs in the fibonacci squence
Test if integer i is a number in the fibonacci sequence. Return true if it is.

6 years ago

Solved


Convert Fahrenheit to Kelvin
Convert the value f in Fahrenheit to Kelvin

6 years ago

Solved


Check if integer is a prime number
Check if integer i is a prime number. Returns logical true '1' if it is.

6 years ago

Solved


An Ohm's Law Calculator
*BACKGROUND / MOTIVATION:* Many important observations in math and science can be described by short, but powerful, equations...

6 years ago

Solved


Alias abs to asb
Create an alias of a built-in function name. Goal is to alias asb with abs for dyslexic typers. The test suite will be ...

6 years ago

Solved


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

6 years ago

Solved


Find matrix of indices for multidimensional matrix.
Given some multidimensional matrix A. Get a matrix of the same size as A where all elements are replaced by their index along th...

6 years ago

Solved


Return the amount of palindromes (words) in the string.
For example: Input: s = 'eye story pop dictionary noon enjoy software moon' Output: amount = 3 Test each word...

6 years ago

Solved


Return ! if array element starts with a certain letter. Otherwise return ?
Input x=['try' 'once' 'more']; s='t' Output ans='!' Input x=['try' 'once' 'more']; s='O' Output ...

6 years ago

Solved


Check if a string starts with another string
Input s='He was so tired' q='He' Output ans = true

6 years ago

Solved


Return the length of the longest word in the string.
Example: Input s='A fractal is a natural phenomenon or a mathematical set that exhibits a repeating pattern that display...

6 years ago

Solved


ASCII sum of phrases
Find the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', th...

6 years ago

Solved


I hope to lose weight healthily...
In order to reduce weight healthily, weight will be reduced by 4% every month. Please calculate how many months it will take...

6 years ago

Solved


A kind of decryption
Please convert the vector to letters by referring to the examples below. (eg.1) input vec=[34 1 59] >>> output s='A Z' (eg...

6 years ago

Solved


Please check the last row
We have data of matrix, that is input. That contains 2 or more rows and the last row should contain the average of each column,...

6 years ago

Solved


Determine whether the input is odd, even, or neither.
Make a function that returns ‘odd’ if the input is odd, ‘even’ if the input if even or ‘error’ if the input is neither odd nor ...

6 years ago

Solved


Is my wife really right?
For every input, output the string 'yes' once. Example: [yes1, yes2] = YesSheIs('Am I right?', 'Do you love me?') yes1 = '...

6 years ago

Solved


Power Numbers
Find the n-th power of m.

6 years ago

Load more