There are 10 types of people in the world
Those who know binary, and those who don't.
The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...
18日 前
解決済み
Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector).
Example:
Inpu...
18日 前
解決済み
Relative ratio of "1" in binary number
Input(n) is positive integer number
Output(r) is (number of "1" in binary input) / (number of bits).
Example:
* n=0; r=...
Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....
18日 前
解決済み
Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...
18日 前
解決済み
Increment up an input vector
Increment up an input vector by adding the indices to the vector values. For example, if an input vector is [3, 2, 6, 1, 6], the...
Find last zero for each column
Given a numeric array of arbitrary size, return the row index of the last zero for each column. If a column contains all nonzero...
Set a diagonal
Given a matrix M, row vector v of appropriate length, and diagonal index d (where 0 indicates the main diagonal and off-diagonal...
18日 前
解決済み
Max index of 3D array
Given a three dimensional array M(m,n,p) write a code that finds the three coordinates x,y,z of the Maximum value.
Example ...
18日 前
解決済み
Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length).
For example:
x = [1 2 3 3 2 1] is s...
18日 前
解決済み
Count consecutive 0's in between values of 1
So you have some vector that contains 1's and 0's, and the goal is to return a vector that gives the number of 0's between each ...
18日 前
解決済み
Oh Zero Zero Zero!!!
Hello all,
So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...