Solved


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

6 years ago

Solved


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

6 years ago

Solved


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

6 years ago

Solved


Calculate the volume of the cube.
Example n = 3; a = volume(n); a = 27

6 years ago

Solved


Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

6 years ago

Solved


Electric Flux
Calculate the flux passing through a surface. E is electric field, A is area.

6 years ago

Solved


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

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

6 years ago

Solved


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

6 years ago

Solved


MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

6 years ago

Solved


Square the input
Given a scalar or vector x, return the square of each element. Example x = [7 2] answer = [49 4]

6 years ago

Solved


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

6 years ago

Solved


Area of a circle
Find the value for area of the circle if diameter is given

6 years ago

Solved


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

6 years ago

Solved


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

6 years ago

Solved


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

6 years ago

Solved


Kinetic Energy
Given mass, m, and kinetic energy, KE, find the velocity of the object.

6 years ago

Solved


Calculate volume of box
Calculate the volume of box,hiven its sides

6 years ago

Solved


Box!
Given a box, find the volume of the cube. With each side = a.

6 years ago

Solved


Kinetic Energy
Given the mass m and velocity v of an object, determine its <http://en.wikipedia.org/wiki/Kinetic_energy kinetic energy>.

6 years ago

Solved


Area of a Square
Given the length x of the side of a regular square, find the area of the square, A.

6 years ago

Solved


Area of a circle
Given the radius x, y would be the area of a circle. Pi = 3.1416

6 years ago

Solved


Find the volume of cone
Find the volume of cone, when given radius(r) and height(h).

6 years ago

Solved


Momentum of an Object
P is momentum, m is mass, and v is velocity. Calculate the momentum for an object.

6 years ago

Solved


Newton's Motion Law
F is force, m is mass, and a is acceleration. Calculate the force for an object.

6 years ago

Solved


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

6 years ago

Solved


Convert radians to degrees
Given input in radians, output to degrees

6 years ago

Solved


Volume of a box
Given a box with a length a, width b, and height c. Solve the volume of the box.

6 years ago

Solved


Celsius to Fahrenheit converter
Convert Celsius to Fahrenheit degrees.

6 years ago

Solved


How many days in a month?
Return the number of days in a given month in 2017. If the input is not a valid month number, return -1. Examples: Input...

6 years ago

Load more