Community Profile

photo

Marcus Homelius


67 total contributions since 2019

Marcus Homelius's Badges

  • Community Group Solver
  • Introduction to MATLAB Master
  • Solver

View details...

Contributions in
View by

Solved


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

2 months 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".

2 months ago

Solved


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

3 months ago

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

3 months ago

Solved


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

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

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

5 months ago

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

7 months ago

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

7 months ago

Solved


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

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

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

8 months ago

Solved


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

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

8 months ago

Solved


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

8 months ago

Solved


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

8 months ago

Solved


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

8 months ago

Solved


inner product of two vectors
inner product of two vectors

8 months ago

Solved


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

8 months ago

Solved


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

8 months ago

Solved


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

8 months ago

Solved


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

8 months ago

Solved


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

8 months ago

Solved


Return the first and last character of a string
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

8 months ago

Solved


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

8 months ago

Solved


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

8 months ago

Solved


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

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

8 months ago

Solved


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

8 months ago

Solved


Return area of square
Side of square=input=a Area=output=b

8 months ago

Load more