Solved

Wrapping the Tower of Pisa
The famous artist Christo Vladimirov Javacheff, who likes pizza, wants to wrap the well-known Italian tower in paper. It is a ci...

10 years ago

Solved

mathematics , probability problem
How many different result can we have, rolling k dice?

10 years ago

Problem

mathematics , probability problem
How many different result can we have, rolling k dice?

10 years ago | 3 | 59 solvers

Solved

arrangement of symbols
There are n different symbols in which m symbols are identical (m<n). How many different arrangement can we make with these symb...

10 years ago

Problem

arrangement of symbols
There are n different symbols in which m symbols are identical (m<n). How many different arrangement can we make with these symb...

10 years ago | 1 | 56 solvers

Solved

Is A the inverse of B?
Given a matrix A and a matrix B, is A the inverse of B? >>A=[2,4;3,5]; >>B=[-2.5,2;1.5,-1]; >>isInverse...

10 years ago

Solved

Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

10 years ago

Solved

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

10 years ago

Solved

Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

10 years ago

Solved

Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

10 years ago

Solved

Convert from Base 10 to base 5
Convert the input number from base 10 into base 5: for example: if a(in base 10)= 5 then a(in base 5)= 10

10 years ago

Problem

Convert from Base 10 to base 5
Convert the input number from base 10 into base 5: for example: if a(in base 10)= 5 then a(in base 5)= 10

10 years ago | 2 | 245 solvers

Solved

Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

10 years ago

Problem

Find number of days
The input is two date in string format (dd-mm-yyyy) find out the number of days between these two dates. Example: input: ...

10 years ago | 0 | 181 solvers

Solved

Find number of days
The input is two date in string format (dd-mm-yyyy) find out the number of days between these two dates. Example: input: ...

10 years ago

Solved

Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

10 years ago

Problem

Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

10 years ago | 4 | 879 solvers

Solved

Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

10 years ago

Solved

The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

10 years ago

Solved

Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

10 years ago

Solved

Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

10 years ago

Solved

Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

10 years ago

Solved

Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

10 years ago

Problem

Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...

10 years ago | 1 | 451 solvers

Solved

Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...

10 years ago

Solved

Back to basics 1 - Saving
Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

10 years ago

Solved

Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

10 years ago

Solved

Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

10 years ago

Solved

Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

10 years ago

Solved

Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

10 years ago