A résolu


Convert a vector into a number
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

environ 12 ans il y a

A résolu


Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

environ 12 ans il y a

A résolu


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

environ 12 ans il y a

A résolu


Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

environ 12 ans il y a

A résolu


function on a moving window
Create a function that applies an operation (such as @sum, @mean, @std, @norm etc) to a moving window of the data. First exam...

environ 12 ans il y a

A résolu


Make blocks of color
Given a (Nx3) sequence of RGB colors, I want to create a (numRowBlocks x numColBlocks x 3) image comprising (blockSize x blockSi...

environ 12 ans il y a

A résolu


Formatting currency numbers
Given a number, format it properly for textual display using the notation $xxx,xxx,xxx.xx. Assume that no more than two digits ...

environ 12 ans il y a

A résolu


edge detection
write a function that gives the indexes of rising or falling edge x is a vector (assume it contains always at least one eleme...

plus de 12 ans il y a

A résolu


cos for boss?
a programmer had too much coffee and his boss needs cos(alpha+beta) correctly, especially when alpha or beta or the coffee are c...

plus de 12 ans il y a

A résolu


swap sign sum & multiply castles
* It is an easy problem, if you know the answer. * Given a square matrix of NxN ordinary numbers. * Initially place N identi...

plus de 12 ans il y a

A résolu


Snakes on a plane
Given the dimensions of a 2-d plane, create a matrix where a "snake" of ones occupies the plane from top left to bottom right. ...

plus de 12 ans il y a

A résolu


count to vector
Return a matrix of numbers of dimension K by N, where K = prod(v), and N=length(v). The rows count from a vector of ones up to v...

plus de 12 ans il y a

A résolu


Leaking?
Graham's law states that the rate of effusion of a gas is inversely proportional to the square root of its molecular weight. A b...

plus de 12 ans il y a

A résolu


Back to basics 26 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of strings of all MATLAB keywords.

plus de 12 ans il y a

A résolu


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

plus de 12 ans il y a

A résolu


Is A the inverse of B?
Given a matrix A and a matrix B, is A the inverse of B? >>A=[2,4;3,5]; >>B=[-2.5,2;1.5,-1]; >>isInverse...

plus de 12 ans il y a

A résolu


Converting Decimal to Binary
Given a decimal number that may include a fractional component, convert it into binary representation. The numbers you are given...

plus de 12 ans il y a

A résolu


Repopulate the City
For any population p of positive integers between pmin and pmax, we can calculate histogram count n for a list of evenly dividin...

plus de 12 ans il y a

A résolu


More luck than brains
Give a random function that guess and return numbers from 1 to 6 exactly like the test suite .

plus de 12 ans il y a

A résolu


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

plus de 12 ans il y a

A résolu


Next lexicographic - permutation
Find next lexicographic - permutation (permutations as it would occur in a dictionary order). E.g: nextP('ABCD') = ABDC I...

plus de 12 ans il y a

A résolu


Greed is good - Simple partition P[n].
Find a simple partition P[n]. E.g. P[10] = 4 + 3 + 2 + 1. # There are many solutions, compute just one set. # Don't repeat ...

plus de 12 ans il y a

A résolu


Compress strings (not springs)
Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...

plus de 12 ans il y a

A résolu


Spiral In
Create an m by n matrix filled with sequential integers starting from 1 and arranged in a counterclockwise spiral that hugs the ...

plus de 12 ans il y a

A résolu


Decode a simplified barcode
Given a bar code from this <http://www.mathworks.com/matlabcentral/cody/problems/602-make-a-simplified-bar-code exercise>: Re...

plus de 12 ans il y a

A résolu


Make a simplified barcode
Given an integer to encode, make a barcode using the following encoding scheme: * The bar code is made from the binary versio...

plus de 12 ans il y a

A résolu


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

A résolu


Reduce - Map-Reduce
Write reduce function, that takes arguments and constantly folds results into next call argument, finally returning a value; ...

plus de 12 ans il y a

A résolu


"Look and say" sequence
What's the next number in this sequence? * [0] * [1 0] * [1 1 1 0] * [3 1 1 0] * [1 3 2 1 1 0] This a variant on the w...

plus de 12 ans il y a

Charger plus