Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n.
Example
For n = 2
then sum of squares = 5 (1^2 + ...
Matlab Basics II - Free Fall
An object freely falling from rest under gravity covers a distance x given by:
x = 1/2 gt^2
write a function that calculat...
2年以上 前
解決済み
Swap two numbers
Example
Input:
a = 10
b = 20
Output
a = 20
b = 10
2年以上 前
解決済み
Calculate compression ratio of engine
Calculate compression ratio of engine given compression volume of cylinder(Vc), piston stroke(s) and valve diameter(d)
Power The Product
EXAMPLE:
INPUT x=10 & y=10
OUTPUT z=1000000
or,
INPUT x=2 & y=3
OUTPUT z= 216
you just need to calculate the product first...
3年弱 前
解決済み
Primes Faster for Large N
This Challenge is to improve the "primes" function for speed. This may be accomplished by fixing memory usage.
The Matlab fun...
Factorial !
Calculate the factorial of a non-negative integer without using the built in function *factorial*
3年弱 前
解決済み
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年弱 前
解決済み
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年弱 前
解決済み
Sum of series V
What is the sum of the following sequence:
Σk(k+1) for k=1...n
for different n?
3年弱 前
解決済み
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年弱 前
解決済み
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年弱 前
解決済み
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...
3年弱 前
解決済み
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...
3年弱 前
解決済み
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年弱 前
解決済み
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年弱 前
解決済み
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>>
...