Community Profile

# Devon John Davenport

##### Last seen: 7 månader ago
108 total contributions since 2020

View details...

Contributions in
View by

Solved

Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

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

Solved

Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

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

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

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

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

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

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

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

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

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

Solved

Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

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

Solved

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

Solved

give nth decimal place of pi
max 15th place after the decimal point is ok for now

Solved

Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

Solved

Is My Wife Wrong?

Solved

Palindrome Check
Check whether the entire matrix is palindrome or not. Example matrix = [7 8 7] matrix_reverse = [7 8 7] So the mat...

Solved

Find the area of the four walls
If length, breadth and height of the walls are given, find the area of the four walls.

Solved

Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

Solved

Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

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

Solved

Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

Solved

06 - Matrix Equations 2
Define the vectors _aVec_ and _bVec_: <<http://samle.dk/STTBDP/Assignment1_2a.png>> and <<http://samle.dk/STTBDP/Assig...

Solved

construct matrix with identical rows
Input a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x. E...

Solved

Create a Matrix of Zeros
Given an input x, create a square matrix y of zeros with x rows and x columns.

Solved

Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

Solved

Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...