Solved


Generate vector according to sign of vector
Generate vector according to sign of vector Example: If A=[-2 0 5] then output must be[-1 0 1] meaning that for negative n...

3 years ago

Solved


Cancel Middle
Write a function called cancel_middle that takes A, an n-by-m matrix, as an input where both n and m are odd numbers an...

3 years ago

Solved


Sort in descending order.

3 years ago

Solved


Find 100 from a Matrix and Replace With 0 with less computation time
pls use this matrix x = [208 40 167 180 112 70 192 215 90 19 231 100 9 100 97 100 ...

3 years ago

Solved


Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

3 years ago

Solved


Find Out sum of principal diagonal element of given matrix
Find out sum of principal diagonal element of given matrix If A=[1 0 0; 0 1 0;0 0 1], then answer must be 3.

3 years ago

Solved


Sideways sum
Given natural number calculate its _population count_.

3 years ago

Solved


Volume difference between Ellipsoid and Sphere
Given an ellipsoid of semi principal axis (a,b,c) find the volume of the difference between this ellipsoid and the sphere with...

3 years ago

Solved


MinMax
* x=[2 4 3 1 6 4 6] * output , y=[1 6 2 4 3] here,y(1) is the minimum of x, y(2) is the maximum of x, y(3) is the 2nd mini...

3 years ago

Solved


King's Cage
Given the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination. ...

3 years ago

Solved


Summing Rows and Columns
Create a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last...

3 years ago

Solved


Count digits
Count total number of digits from 1 to n. * n=13 * output=17 since from [1-9] total 9 digits.[10-13] total 4*2=8 digits.

3 years ago

Solved


generate the matrix
given 3 inputs e.g [2,3,4] -- generate a matrix like below -- [2 2 0 0 0 0 0 0 0; 2 2 0 0 0 0 0 0 0; 0 0 3 3 3 0 0 0 0; 0 0...

3 years ago

Solved


GCD

3 years ago

Solved


Tribonacci Sequence
Generate the tribonacci sequence upto n

3 years ago

Solved


Zero
given an integer a, find the smallest possible integer b(b>0) such that their bitwise logical AND is zero. * if a=11(1011) t...

3 years ago

Solved


MinMax mapping
Given a matrix, map all the elements within a given interval. For example, a=[ 2 5 10] mapped in the interval [1,2] ...

3 years ago

Solved


generate nth pentatope number
https://en.wikipedia.org/wiki/Pentatope_number

3 years ago

Solved


Back to basics 10 - Max Float
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

3 years ago

Solved


Which quadrant?
Given a complex number, output quadrant 'I' 'II' 'III' or 'IV' | II | I | ...

3 years ago

Solved


The Dark Side of the Die
It is well-known that opposite sides of a classic hexahedral die add to 7. Given a vector of dice rolls, calculate the sum of th...

3 years ago

Solved


Guess the Coefficients!
Given a polynomial _p_ known to have positive integer coefficients, deduce the values of the coefficients. For example: ...

3 years ago

Solved


Next Higher Power of B
|Given a number _n_ and a base _B_ greater than 1, return the lowest integer power of _B_ that is greater than or equal to _n_. ...

3 years ago

Solved


Pandiagonal Prime Magic Square Verification
Verify if an NxN matrix is a Pandiagonal Prime Magic Square. Required properties: 1) N^2 prime values ( No repeats, 1 ...

3 years ago

Solved


Leftovers? Again?!
I am thinking of a positive number X. To determine what number I am thinking of, I will give you two 1xN vectors. The first ve...

3 years ago

Solved


Equidistant numbers containing certain value in an interval
Given a lower and upper bound of an interval, distance between numbers, and one particular number from that interval, create an ...

3 years ago

Solved


Vector LCM
Find Least Common Multiple of a given vector. Need general solution as the test suite will be expanded. Function Template: fu...

3 years ago

Solved


deconvolution
* Suppose there is a vector v like [1 0 0 -1], representing polynomial coefficients. * In this example, the polynimial is 1*x^3...

3 years ago

Solved


Vectorizing, too easy or too hard?
Please insert a . before any ^, * or / in the string. That's it!!

3 years ago

Solved


Cannon Ball
Given g (acceleration due to gravity) and desired altitude x, find the minimum ground velocity of a cannon ball to reach x.

3 years ago

Load more