A résolu


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

plus de 2 ans il y a

A résolu


Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

plus de 2 ans il y a

A résolu


Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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.

plus de 2 ans il y a

A résolu


Counting down
Create a vector that counts from 450 to 200 in increments of 10.

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Speed of car
Calculate the Speed of car given its Distance travelled and time taken in x and y respectively

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

plus de 2 ans il y a

A résolu


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]

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Draw 'E'
Draw a x-by-x matrix 'E' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

plus de 2 ans il y a

A résolu


Draw 'C'.
Given x as input, generate a x-by-x matrix 'C' using 0 and 1. example: x=4 ans= [0 1 1 1 1 0 0 0 ...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

plus de 2 ans il y a

A résolu


Calculate the area of a triangle between three points
Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

plus de 2 ans il y a

A résolu


Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<https://i.imgur.com/jlZDHhq.png>> ...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

Charger plus