Community Profile

# Sibi

### VIT

1,812 total contributions since 2020

Research scholar at VIT

View all

Contributions in
View by

Solved

Subset Sum
Given a vector v of integers and an integer n, return the the indices of v (as a row vector in ascending order) that sum to n. I...

2 hours ago

Solved

find location of indexes

2 hours ago

Solved

Find the solution of algebraic equation
Find the solution of algebraic equation of the form an*x^n + a(n-1)*x^(n-1) + (an-2)*x^(n-2)+...... a2*x^2 + a1*x^1 + a0 = 0;...

3 hours ago

Solved

Alternating 1´s and 0´s in a matrix
Given an odd number n, write a function that creates a matrix y with dimension nxn alternating 1's and 0's, and starting with 1 ...

3 hours ago

Solved

Alternate list of elements
Write a function that combines two lists by alternating the elements, e.g. ['a','b','c'], ['1','2','3'] → 'a1b2c3'.

3 hours ago

Solved

Get the value 100
Knowing that 123-45-67+89=100, write a function that gives this result for any order of the digits in the input. Otherwise, the ...

3 hours ago

Solved

Ordinal numbers
Given an integer n, return the corresponding ordinal number as a character string. For example, ord(1)='1st' ord(2)=...

4 hours ago

Solved

Pluralization
Define function plu(n) that returns '' (an empty string) if n=1, or 's' otherwise. This is handy for displaying messages from a...

4 hours ago

Solved

Suppress the French accent. Example 'Déjà présent' -> 'Deja present'

5 hours ago

Solved

Create cell array of numeric arrays
Convert the input to a cell array, but only if necessary. If the input is a numeric array, return a 1-by-1 cell array contain...

21 hours ago

Solved

Cumulative difference
Given an array, return the cumulative difference. Example a = [ 1 3 5 7 ] cumdiff = [ 1 2 1 -2 ]

1 day ago

Solved

Find the numeric characters in a string and return their index
Given a string S, return the index of any numeric characters. S = 'The next meeting will be held in 2 weeks.'; idx = fin...

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

1 day ago

Solved

basic matrix operations: rotate and find sum of diagonal elements of the resultant matrix
For given input matrix a, rotate it by 90 degrees and find the sum of the diagonals. Example: Input: a = 1 ...

1 day ago

Solved

1 day ago

Solved

The maximum sum of squares (testing)
Create a function file with an input maxval to determine the maximum number of terms for the series 1^2 + 2^2 + 3^2 + ... such t...

1 day ago

Solved

Find index of a string in a cell array
Write a function that finds the index at which the cell array of strings C contains the exact string S. So if C = {'twe...

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

2 days ago

Solved

how many of the entries are positive?
Given x= sin(linspace(0,10*pi,100)), how many of the entries are positive?

2 days ago

Solved

poll: would you like the regexp (?@cmd) functionality to be banned in Cody?
This problem is a poll (and a little bit of "white hat hacktivism" as well) regarding Cody users sentiment about the use of rege...

2 days ago

Solved

Toeplitz Matrix
For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

2 days ago

Solved

means
Calculate the arithmetic, the geometric and the harmonic mean of a given vector (with positive elements) and return them in a ve...

2 days ago

Solved

Weighted average
Compute the weighted average Y, of the vector A, given the weight vector W. The weighted average is the sum of the dot produc...

3 days ago

Solved

Sideways sum
Given natural number calculate its _population count_.

3 days ago

Solved

number of groups
In a classroom, *n* students work on a special project and the other students work in groups of five. If there are 18 students i...

3 days ago

Solved

Electric Flux
Calculate the flux passing through a surface. E is electric field, A is area.

3 days ago

Solved

Convert Angstrom to Meters
Write a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)

3 days ago

Solved

Get the combinations
Consider p,q = 2 vectors of same or different length. Get a Output Array which has all the possible combinations of Elements o...

4 days ago

Solved

Return all matrix elements except elements on diagonal
Consider a given Matrix A=[a b c; d e f; g h i] then return a row vector T such that it contains all the El...

4 days ago