Solved

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];

presque 5 ans ago

Solved

Community Problem 500!

In honor of this being the 500th Community problem, see if you can create a function that has a Cody size of 500. It can do any...

presque 5 ans ago

Solved

The rabbit problem

Someone discovered that rabbits reproduce at the rate of fibonnaci so you just input the number and it will print the fibonnaci ...

presque 5 ans ago

Solved

Calculate the nth Fibonacci number USING 'Golden Ratio' concept

f = [1 1 2 3 5 8 13 ...] If n=6, f(6)=8

presque 5 ans ago

Solved

Find out sum of all elements of given Matrix

Find out sum of all elements of given Matrix A=[1 2 3;4 5 6 ;7 8 9]; Answer must be: 45 *If you like this problem, pl...

presque 5 ans ago

Solved

Moving average (variable kernel length)

Find the moving average in a vector. The kernel length is a variable. For example x = 1:10 kernel_length = 2 would r...

presque 5 ans ago

Solved

Area of a Square

Inside a square is a circle with radius r. What is the area of the square?

presque 5 ans ago

Solved

Set some matrix elements to zero

First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

presque 5 ans ago

Solved

subtract central cross

Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

presque 5 ans ago

Solved

Symmetric matrix

You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

presque 5 ans ago

Solved

Tiling a matrix

Given a matrix and a number of columns, replicate matrix in a single row

presque 5 ans ago

Solved

Roots

Find out the roots of a given polynomial equation.Given are the coefficients of the equation.

presque 5 ans ago

Solved

Number of odd and even elements within matrix

Input(m) - any matrix with integers Output(n) - n(1)=number of odd elements, n(2)=number of even elements Example: * m=...

presque 5 ans ago

Solved

Sum of the Matrix Elements

Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns. E...

presque 5 ans ago

Solved

calculate linear convolution two vectors

for e.g in: a = [1 2 3] b = [4 5 6] out: y = [4 13 28 27 18]

presque 5 ans ago

Solved

Factorial Numbers

Factorial is multiplication of integers. So factorial of 6 is 720 = 1 * 2 * 3 * 4* 5 *6 Thus 6 factorial = factorial(720)....

presque 5 ans ago

Solved

Which values occur exactly three times?

Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

presque 5 ans ago

Solved

Bit Reversal

Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

presque 5 ans ago

Solved

Count decimal digits of a number

* Given an integer number you have to return the number of its digits. * For example 248 has 3 digits and 1589 has 4 digits ...

presque 5 ans ago

Solved

Upper triangular matrix

Create a function to retrieve the upper triangular matrix of a matrix (without using tril). The matrix will always be square. ...

presque 5 ans ago

Solved

Signed Magnitude

For a given input vector, return the value that is furthest from zero. For example, if x = [1 2 -12] return -12.

presque 5 ans ago

Solved

Cell Counting: How Many Draws?

You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

presque 5 ans ago

Solved

Vector LCM

* Find Least Common Multiple of a given vector. * Need general solution as the test suite will be expanded. * Function Templa...

presque 5 ans ago

Solved

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

presque 5 ans ago

Solved

07 - Common functions and indexing 6

Create a variable _m_ as a magic square with the size 6 x 6 Magic squares are defined as square matrices, where the sum of a...

presque 5 ans ago

Solved

commutative?

Given the handle to a binary function that takes two ordinary numbers, test if the function is commutative.

presque 5 ans ago

Solved

Add a row of zeros on top of a matrix

Given a matrix, insert a row of zeros as the top row.

presque 5 ans ago

Solved

Compare two input matrices

Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0". Exa...

presque 5 ans ago