Solved


Replace every 3rd element in a vector with 4
x is a vector of undetermined length You are to replace every 3rd element with the number 4, example: x = [11 23 34 43 2 3...

12 months ago

Solved


Matlab Basics II - Extract last 3 elements of a vector
Let x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives t...

12 months ago

Solved


Normalizing a vector
Normalizing a set of values is an important operation in mathematics, consisting in affinely transforming a set of values in an ...

12 months ago

Solved


Sort by absolute value
Given a list of numbers, arrange them in ascending order based on their absolute values. For example, for the list [-30, -5, 1...

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

12 months ago

Solved


Min-Max digit

12 months ago

Solved


Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
The given function returns the index of the maximum value in a given matrix. such as X=[4,3,4,5,9,12,0,5] Ans= 6 if maxim...

12 months ago

Solved


End Digits

12 months ago

Solved


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input is n=4 th...

12 months ago

Solved


Replace with Lower
Given a list of integers, for each element, replace it with the minimum integer found in the sub-list to its strict right (exclu...

12 months ago

Solved


Remove Adjacent Pairs
Given an array of integers where adjacent elements may be identical, your task is to remove these adjacent pairs. If removing on...

12 months ago

Solved


Check if inputted variable is a string or a number
Check if a inputted variable is a number or a string, given a string input (i.e. '1' is 1 and thus a number, 'a' is a string).

12 months ago

Solved


Replace 0 indices in array with 1's
Take a incoming vector, and replace 0's with ones

12 months ago

Solved


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

12 months 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=...

12 months ago

Solved


Vector of numbers divisible by 3
* Input(n) - any integer * Output(v) - vector with numbers divisible by 3(exept 0) starting from n to 0 Examples: * n=6...

12 months ago

Solved


Replace odd number in given matrix by zero
Replace the odd numbers in a given matrix with zero. Example A = [ 17 24 1 8 15 23 5 7 ...

12 months ago

Solved


Determine the mean of matrix
Determine the mean of matrix without using mean function Hint: use simple algorithm

12 months ago

Solved


LocateMembership | Membership of Matrix in another matrix
Let a and b be given by a = [ 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 4 0 0 0 ] b = [ 2 1 ...

12 months ago

Solved


Create incrementing array
Given a and b generate an output matrix as shown in following examples: a=2 b=5 output=[2 20 200 2000 20000] a=4 b...

12 months ago

Solved


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

12 months ago

Solved


What is Sum Of all elements of Matrix
Given the matrix x, return the sum of all elements of matrix. Example: Input x = [ 1 2 0 0 0 0 6 9 3 3 ] ...

12 months 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

12 months ago

Solved


Repeat The Components of Matrix
Repeat The components of a matrix so that the size of the output matrix is double to input matrix and components are repeated ne...

12 months ago

Solved


Sort the vector with the given index
Given x = [1 2 4 8 17] and t = [1 3 2 5 4] then y = [1 4 2 17 8].

12 months ago

Solved


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

1 year ago

Solved


remove numbers from a string
check the given string for any numbers.in case one is found,remove it.but the two portions should be separated. if more than one...

1 year ago

Solved


Capitalize
Capitalize the 1st letter of each input. Other letters should be lowercase. For example - a='alphaS' >> 'Alphas' a='1...

1 year 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] ...

1 year ago

Solved


Abelian Sandpile - 02
Generate a matrix like Abelian Sandpile where the four corner element is n. For example, n=4 [4 3 2 1 ...

1 year ago

Load more