Gelöst


Rainbow matrix
Create a "rainbow matrix" as described in the following examples Input = 3 Output = [ 1 2 3 2 3 2 ...

mehr als 5 Jahre vor

Gelöst


Matrix Construction I
Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

mehr als 5 Jahre vor

Gelöst


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

mehr als 5 Jahre vor

Gelöst


Create a patchwork matrix
This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

mehr als 5 Jahre vor

Gelöst


Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
For example, if n=2 (maximum value), the output matrix should be [1 1 1 1 1; 1 2 2 2 1; 1 2 1 2 1; 1 2 2 2 1; 1...

mehr als 5 Jahre vor

Gelöst


Make a Star Pyramid
Create a star pyramid. First line will have 1 star, second will have two stars and so on... a basic program which is easily done...

mehr als 5 Jahre vor

Gelöst


Pascal's Matrix
Given an integer n &ge; 0, generate the ( _n_+1) &times; ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...

mehr als 5 Jahre vor

Gelöst


Mirror Image matrix across anti-diagonal
Given an input number x, create a mirror image matrix 'Y' across the anti-diagonal. For example, if x=3, Y = [1 2 3; ...

mehr als 5 Jahre vor

Gelöst


Create a matrix X, where each column is a shifted copy of the vector v
Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

mehr als 5 Jahre vor

Gelöst


Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

mehr als 5 Jahre vor

Gelöst


Special matrix
Make a square matrix with this shape. For n=4 M = 1 1 0 0 1 0 1 0 0 1 0 ...

mehr als 5 Jahre vor

Gelöst


Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...

mehr als 5 Jahre vor

Gelöst


Create a Multiplication table matrix...
Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

mehr als 5 Jahre vor

Gelöst


Read a column of numbers and interpolate missing data
Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...

mehr als 5 Jahre vor

Gelöst


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

mehr als 5 Jahre vor

Gelöst


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

mehr als 5 Jahre vor

Gelöst


inner product of two vectors
inner product of two vectors

mehr als 5 Jahre vor

Gelöst


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

mehr als 5 Jahre vor

Gelöst


Trimming Spaces
Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

mehr als 5 Jahre vor

Gelöst


Return a list sorted by number of occurrences
Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

mehr als 5 Jahre vor

Gelöst


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

mehr als 5 Jahre vor

Gelöst


Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

mehr als 5 Jahre vor

Gelöst


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

mehr als 5 Jahre vor

Gelöst


"mirror" matrix
Create n x 2n "mirror" matrix of this type: Examples For n = 2 m = [ 1 2 2 1 1 2 2 1 ] For n = 3 m = ...

mehr als 5 Jahre vor

Gelöst


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

mehr als 5 Jahre vor

Gelöst


Rotate input square matrix 90 degrees CCW without rot90
Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

mehr als 5 Jahre vor

Gelöst


Matrix with different incremental runs
Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

mehr als 5 Jahre vor

Gelöst


Make an awesome ramp for a tiny motorcycle stuntman
Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

mehr als 5 Jahre vor

Gelöst


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

mehr als 5 Jahre vor

Gelöst


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

mehr als 5 Jahre vor

Mehr laden