Community Profile

# Jean-Christophe

### Daimler AG

62 total contributions since 2016

View details...

Contributions in
View by

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.

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

9 mesi ago

Solved

Multiply by 3
Given the variable x as your input, multiply it by three and put the result in y.

9 mesi ago

Solved

Box!
Given a box, find the volume of the cube. With each side = a.

9 mesi ago

Solved

Create a vector
Create a vector from 0 to n by intervals of 2.

9 mesi ago

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];

9 mesi ago

Solved

Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

9 mesi ago

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]

9 mesi ago

Solved

Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

9 mesi ago

Solved

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

9 mesi ago

Solved

Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

9 mesi ago

Solved

Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

9 mesi ago

Solved

Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

circa 2 anni ago

Solved

Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

circa 2 anni ago

Solved

Add a block to a model
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/add-block-eqn.png>> In this case, the slope of...

circa 2 anni ago

Solved

Produce a cosine wave
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/cosine-eqn.png>>

circa 2 anni ago

Solved

Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

circa 2 anni ago

Solved

Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

circa 2 anni ago

Solved

Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

oltre 3 anni ago

Solved

Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

oltre 3 anni ago

Solved

Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

oltre 3 anni ago

Solved

Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

oltre 3 anni ago

Solved

Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

oltre 3 anni ago

Solved

Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

oltre 3 anni ago

Solved

Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

oltre 3 anni ago

Solved

Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

oltre 3 anni ago

Solved

Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

oltre 3 anni ago

Solved

Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

oltre 3 anni ago

Solved

Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

oltre 3 anni ago

Solved

Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

oltre 3 anni ago