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

3 mois ago

Solved

Finding Perfect Squares

Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

3 mois ago

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

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

3 mois ago

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. <<https://imgur...

3 mois ago

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

3 mois ago

Solved

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

3 mois ago

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

3 mois ago

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? <<https://imgur.com/x6hT6mm.png>> ...

3 mois ago

Solved

Roll the Dice!

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

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

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

7 mois ago

Solved

Area of a Square

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

7 mois ago

Solved

Area of a triangle

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

7 mois ago

Solved

Find the Nth Root of a Given Number

Find the Nth root of a given number x. Examples x = 4096 n = 4 y = 8 x = 625 n = 5 y = 3.6239

7 mois ago

Solved

Back to basics 11 - Max Integer

Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

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

7 mois 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 mois ago

Solved

Binary numbers

Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

7 mois ago

Solved

Convert given decimal number to binary number.

Convert given decimal number to binary number. Example x=10, then answer must be 1010.

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

7 mois ago

Solved

Add two numbers

Calculate the sum of two numbers. Example input = [2 3] output = 5

7 mois ago

Solved

Right and wrong

Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

7 mois ago

Solved

radius of a spherical planet

You just measured its surface area, that is the input.

7 mois ago

Solved

Create a Matrix of Zeros

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

7 mois ago

Solved

Create a Standard Size Vector

Given an input x, create a row vector y from 1 to x with 5 elements.

7 mois ago

Solved

Determine if input is odd

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

7 mois ago