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.

mer än 2 år ago

Solved

Generate this matrix
Generate the following matrix. n = 2; out = [-4 -3 -2 -1 0 -3 -2 -1 0 1 -...

mer än 2 år ago

Solved

The Matrix Construction
Given two input ,first one is CN (Column Number), Second one is Dim Can you produce such a matrix for example CN=6; Dim=2 ...

mer än 2 år ago

Solved

Sort rows of a matrix
Sort rows of matrix A in an ascending order according to the last column Example input: A = [1 2 3;7 8 9;4 5 6]; Exam...

mer än 2 år ago

Solved

Vector to 3-Column Matrix
Consider a vector *A* such as A = [1 2 3 3 4 5 6] Can you convert this vector to a three-column matrix like this: ...

mer än 2 år ago

Solved

Find the maximum two numbers of every column of a matrix
Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

mer än 2 år ago

Solved

Nonuniform quantizer as a piecewise constant function
Implement a nonuniform quantizer as the following piecewise function: y = -3.5, x < -3 y = -1.5, -3 &#8804; x < -1 y = ...

mer än 2 år ago

Solved

Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

mer än 2 år ago

Solved

Get a new matrix by mapping each element of an arbitrary-sized input matrix using lookup table
A is a matrix of any size and dimension. Each element of matrix A belongs to a set S of integers. B is a 2-D matrix defining out...

mer än 2 år ago

Problem

Get a new matrix by mapping each element of an arbitrary-sized input matrix using lookup table
A is a matrix of any size and dimension. Each element of matrix A belongs to a set S of integers. B is a 2-D matrix defining out...

mer än 2 år ago | 0

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

mer än 2 år ago

Solved

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

mer än 2 år ago

Solved

Back to basics - mean of corner elements of a matrix
Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

mer än 2 år ago

Solved

Toeplitize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

mer än 2 år ago

Solved

Go to the head of the class!
You're given a matrix and a single number. If that number is in the matrix, reorder the matrix so that number is in the first r...

mer än 2 år ago

Solved

Sum of odd numbers in a matrix
Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27

mer än 2 år ago

Solved

Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

mer än 2 år ago

Solved

Remove the air bubbles from a vector
_*A reduced version of Problem 112*_ Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...

mer än 2 år ago

Solved

Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

mer än 2 år ago

Solved

Write a function man that takes a row vector v and returns a matrix H as follows..
Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the eleme...

mer än 2 år ago

Solved

Remove entire row and column in the matrix containing the input values
Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

mer än 2 år ago

Solved

Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

mer än 2 år 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.

mer än 2 år ago

Solved

frame of the matrix
Given the matrix M, return M without the external frame.

mer än 2 år ago

Solved

Given a 4x4 matrix, swap the two middle columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

mer än 2 år ago

Solved

matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

mer än 2 år ago

Solved

Enlarge array
Given an m-by-n numeric array (A) and a 1-by-2 vector (sz) indicating the dimensions [p q] to enlarge each element, return an (m...

mer än 2 år ago

Solved

Removing rows from a matrix is easy - but what about inserting rows?
Assume A is a 5-by-5 matrix. A([2,4],:) = [] is a quick way to remove rows 2 and 4. Can you find a quick way to insert rows into...

mer än 2 år ago

Solved

Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

mer än 2 år 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...

mer än 2 år ago