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

nästan 4 år 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 ...

nästan 4 år 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...

nästan 4 år ago

Solved


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

nästan 4 år 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...

nästan 4 år ago

Solved


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

nästan 4 år 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 ...

nästan 4 år 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...

nästan 4 år 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...

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år 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.

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år 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

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år 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>.

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år 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 ...

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


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

nästan 4 år ago

Solved


Celsius to Fahrenheit converter
Convert Celsius to Fahrenheit degrees.

nästan 4 år 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...

nästan 4 år ago

Load more