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 years 前
已解决
Determinant of a 3x3 Matrix
Return the determinant of a 3x3 matrix. The built-in Matlab function det is not allowed.
3 years 前
已解决
Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...
Sum of first n positive integers
Given n, find the sum of first n positive integers
Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these terms is 55
Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is,
h = (f o g)(x) = f(g(x))
...
3 years 前
已解决
Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x.
<<https://i.imgur.com/jlZDHhq.png>>
Image courtesy of <http://up...
3 years 前
已解决
Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...