Solved

Distance walked 1D

Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

4 months ago

Solved

Divisible by 2

This is the first problem in a set of "divisible by x" problems. You will be provided a number as a string and the function you ...

4 months ago

Solved

Get the length of a given vector

Given a vector x, the output y should equal the length of x.

4 months ago

Solved

Matlab Basics - Absolute Value

Write a script that returns the absolute value of the elements in x e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]

4 months ago

Solved

sum of first 'n' terms

Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

4 months ago

Answered

Can anybody help me to solve this? Its a Triangle sequence

n=3 sides=[3 4 5]; if (n>1) for i=1:(n-1) sides=[sides(2) sides(3) (sides(2)^2+sides(3)^2)^0.5] end end sort([sides...

Can anybody help me to solve this? Its a Triangle sequence

n=3 sides=[3 4 5]; if (n>1) for i=1:(n-1) sides=[sides(2) sides(3) (sides(2)^2+sides(3)^2)^0.5] end end sort([sides...

4 months ago | 0

Solved

Find parts of a circle.

Given radius (r) of a circle find the diameter (d), circumference (c), an area (a).

4 months ago

Solved

Matlab Basics II - Intervals

Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

4 months ago

Solved

Find the product of a Vector

How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?; x = [1 : 0.5 : 6]; y ...

4 months ago

Solved

Arrange vector in ascending order

Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

4 months ago

Solved

Multiply a column by a row

* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

4 months ago

Solved

Volume of a box

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

4 months ago

Solved

Basics: 'Find the eigenvalues of given matrix

Find the eigenvalues y for a given matrix x.

4 months ago

Solved

Unit Matrix

Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

4 months ago

Solved

metre to feet converter

The idea is to make a converter, which exchange meters to feets. We use a factor of 1m = 3.281*1f. so 3m are equals to 9.843 m...

4 months ago

Solved

find the surface area of a cube

given cube side length x, find the surface area of the cube, set it equal to y

4 months ago

Solved

Matlab Basics II - squares

Write a function that takes matrix A, and squares each element in the matrix example: A = [1 2 3] output = [1 4 9]

4 months ago

Solved

Matlab Basics - Rounding I

Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

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

4 months ago

Solved

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

4 months ago

Solved

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

4 months ago

Solved

What is Sum Of all elements of Matrix

Given the matrix x, return the sum of all elements of matrix. Example: Input x = [ 1 2 0 0 0 0 6 9 3 3 ] ...

4 months 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

4 months ago