Community Profile

# Dominik Glettler

54 total contributions since 2019

#### Dominik Glettler's Badges

View details...

Contributions in
View by

Solved

Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

6 mesi 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".

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

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

6 mesi ago

Solved

Return the 3n+1 sequence for n
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...

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

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

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

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

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

7 mesi ago

Solved

Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

7 mesi ago

Solved

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

7 mesi ago

Solved

Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

7 mesi ago

Solved

Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

7 mesi ago

Solved

Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

7 mesi ago

Solved

Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

7 mesi ago

Solved

Convert radians to degrees
Given input in radians, output to degrees

7 mesi ago

Solved

Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

7 mesi ago

Solved

radius of a spherical planet
You just measured its surface area, that is the input.

7 mesi ago

Solved

Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

7 mesi ago

Solved

Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

7 mesi ago

Solved

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

7 mesi ago

Solved

Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

7 mesi ago

Solved

Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

7 mesi ago

Solved

Find max
Find the maximum value of a given vector or matrix.

7 mesi ago

Solved

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

7 mesi ago

Solved

Inner product of two vectors
Find the inner product of two vectors.

7 mesi ago

Solved

Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

7 mesi ago

Solved

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

7 mesi ago

Solved

Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

7 mesi ago