Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise
7年以上 前
解決済み
Find max
Find the maximum value of a given vector or matrix.
7年以上 前
解決済み
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]
7年以上 前
解決済み
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...
Add two numbers
Calculate the sum of two numbers.
Example
input = [2 3]
output = 5
7年以上 前
解決済み
Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody.
Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...
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...
7年以上 前
解決済み
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...
7年以上 前
解決済み
Sum of diagonal of a square matrix
If
x = [1 2 4; 3 4 5; 5 6 7]
then y should be the sum of the diagonals of the matrix
y = 1 + 4 + 7 = 12
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...
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...
7年以上 前
解決済み
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...
7年以上 前
解決済み
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....
7年以上 前
解決済み
Weighted average
Given two lists of numbers, determine the weighted average.
Example
[1 2 3] and [10 15 20]
should result in
33.333...
7年以上 前
解決済み
Shift elements of vector left
Shift elements of vector to the left.
For ex. : Input_vec = [1 2 3 4 5]
Output_vec = [2 3 4 5 1]