Community Profile

# Aritra Chatterjee

139 total contributions since 2012

View details...

Contributions in
View by

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

plus d'un an ago

Solved

Find the index of the first occurrence of a value in a matrix
Given a matrix of scalars, find the first occurrence of -1 in each column. Output NaN for a column which does not contain the va...

environ 6 ans ago

Solved

"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

environ 6 ans ago

Solved

ベクトルのスケーリング

environ 6 ans ago

Solved

Do Fast Fourier Transformation
Example Fast Fourier Transformation from vector [2,1]) ans = 3 1

environ 6 ans ago

Solved

Find out the best cricketer
Irrespective of input, return Sachin Tendulkar as a output

environ 6 ans ago

Solved

persistant sum
There will be 9 tests for this problem. In each test you will be provided with 2 integers n=[n1,n2], where n2 is equal to t...

environ 6 ans 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...

plus de 6 ans ago

Solved

Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

plus de 6 ans ago

Solved

sum of non-primes
The sum of the non-primes below 10 is 1+4+6+8+9+10=38 Find the sum of all the non-primes below the input, N.

plus de 6 ans ago

Solved

Count ones
Write a program to count number of ones (1s) in an integer variable input. For example: Input x=2200112231 output y=3 I...

plus de 6 ans ago

Solved

Negative matrix
Change the sign of all elements in given matrix.

plus de 6 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. ...

plus de 6 ans ago

Solved

Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

plus de 6 ans ago

Solved

Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

plus de 6 ans ago

Solved

Make a Palindrome Number
Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...

plus de 6 ans ago

Solved

User defined nextpow function
Create a function which will take 2 arguments as n and x, and return y, where, n^y >= abs(x). [ Similar to builtin "nextpow2" fu...

plus de 6 ans ago

Solved

Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

plus de 6 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...

plus de 6 ans ago

Solved

Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

plus de 6 ans ago

Solved

Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

plus de 6 ans ago

Solved

Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

plus de 6 ans ago

Solved

Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

plus de 6 ans ago

Solved

Infernal Recursion
Consider the recursion relation: x_n = (x_(n-1)*x_(n-2))^k Given x_1, x_2, and k, x_n can be found by this definition. Wr...

plus de 6 ans ago

Solved

CARDS PROBLEM
Read my mind and tell me the card number that I have now in my hands.

plus de 6 ans ago

Solved

Check to see if a Sudoku Puzzle is Solved
*Description:* Your task, should you choose to accept it, is to make a function that checks to see if a 9x9 matrix of integer...

plus de 6 ans ago

Solved

Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

plus de 6 ans ago

Solved

given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

plus de 6 ans ago

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

plus de 6 ans ago

Solved

Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

plus de 6 ans ago