解決済み

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

9ヶ月 前

解決済み

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. <<http://upload...

9ヶ月 前

解決済み

Dimensions of a rectangle

The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

9ヶ月 前

解決済み

Side of a rhombus

If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

9ヶ月 前

解決済み

Side of an equilateral triangle

If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

9ヶ月 前

解決済み

Area of an equilateral triangle

Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Summing digits

Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Back to basics - mean of corner elements of a matrix

Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Find the numeric mean of the prime numbers in a matrix.

There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Building matrices

If you have matrix A, create matrix B using matrix A as an "element" A = [1 2 3 4; 5 6 7 8...

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

middleAsColumn: Return all but first and last element as a column vector

Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

9ヶ月 前

解決済み

Return unique values without sorting

If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Given area find sides

In a right angle triangle given area 'A' one arm=x, another arm=2x then find the value of x. For example, area A=400 then ...

9ヶ月 前

解決済み

No Twins?

Write a function that accepts as input a vector and returns the same vector, but retaining only the first occurrence of an eleme...

9ヶ月 前

解決済み

Pizza!

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

9ヶ月 前

解決済み

Back to basics 2 - Function Path

Covering some basic topics I haven't seen elsewhere on Cody. Given a string that is the name of a MATLAB function, return a s...

9ヶ月 前

解決済み

Back to basics 13 - Input variables

Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

9ヶ月 前