Community Profile

Brendan Coetzer

36 total contributions since 2019

View details...

Contributions in
View by

Solved

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

etwa ein Jahr 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...

etwa ein Jahr ago

Solved

Area of a Square
Inside a square is a circle with radius r. What is the area of the square?

etwa ein Jahr ago

Solved

Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

etwa ein Jahr ago

Solved

select the primes of a vector
Find the prime numbers in a vector

etwa ein Jahr ago

Solved

Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

etwa ein Jahr 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 ...

etwa ein Jahr ago

Solved

Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

etwa ein Jahr ago

Solved

Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

etwa ein Jahr ago

Solved

Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

etwa ein Jahr 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.

etwa ein Jahr ago

Solved

Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

etwa ein Jahr 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...

etwa ein Jahr ago

Solved

Find the hypotenuse
Given a and b (the two sides of a right-triangle), find c, the hypotenuse.

etwa ein Jahr ago

Solved

Magic!
Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

etwa ein Jahr ago

Solved

Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

etwa ein Jahr ago

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

etwa ein Jahr ago

Solved

multiply by three
Given the variable x as your input, multiply it by 3 and put the result equal to y. Examples: Input x = 2 Output y is ...

etwa ein Jahr 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...

etwa ein Jahr ago

Solved

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

etwa ein Jahr ago

Solved

What is Sum Of all elements of Matrix
Given the matrix x, return the sum of all elements of matrix. Example: Input x = [ 1 2 0 0 0 0 6 9 3 3 ] ...

etwa ein Jahr ago

Solved

Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.

etwa ein Jahr ago

Solved

Y=X
Given an input variable x, output a variable y that is equal in value to x. Example: Input x = 1 Output y is 1 Inp...

etwa ein Jahr ago

Solved

Calculate square and cube of number
Calculate square and cube of number x

etwa ein Jahr ago

Solved

Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.

etwa ein Jahr ago

Solved

factorial of a number x
Factorial of a number x

etwa ein Jahr ago

Solved

Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

etwa ein Jahr ago

Solved

Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

etwa ein Jahr ago

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

etwa ein Jahr ago

Solved

Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

etwa ein Jahr ago