Risolto


Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given number of...

23 giorni fa

Risolto


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

23 giorni fa

Risolto


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

23 giorni fa

Risolto


Pi Estimate 1
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

23 giorni fa

Risolto


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not to use d...

23 giorni fa

Risolto


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

23 giorni fa

Risolto


Inner product of two vectors
Find the inner product of two vectors.

23 giorni fa

Risolto


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

23 giorni fa

Risolto


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

25 giorni fa

Risolto


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

27 giorni fa

Risolto


calculate the length of matrix
input 1 array, calculate the length

27 giorni fa

Risolto


Simple equation: Annual salary
Given an hourly wage, compute an annual salary

27 giorni fa

Risolto


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

27 giorni fa

Risolto


Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.

27 giorni fa

Risolto


MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

27 giorni fa

Risolto


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

27 giorni fa

Risolto


Check if number exists in vector
Return 1 if number a exists in vector b otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,2,3]; Returns 1.

27 giorni fa

Risolto


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

27 giorni fa

Risolto


Find max
Find the maximum value of a given vector or matrix.

27 giorni fa

Risolto


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

27 giorni fa

Risolto


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

27 giorni fa

Risolto


Create a vector
Create a vector from 0 to n by intervals of 2.

27 giorni fa

Risolto


Is my wife right?
Regardless of input, output the string 'yes'.

27 giorni fa

Risolto


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

27 giorni fa

Risolto


Zero or hero
A number will be given as an input. You can be hero if it's not zero. (Just for fun)

27 giorni fa

Risolto


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

27 giorni fa

Risolto


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

27 giorni fa

Risolto


Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<https://i.imgu...

27 giorni fa

Risolto


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

27 giorni fa

Risolto


Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

27 giorni fa

Carica altro