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)...
2ヶ月 前
解決済み
A Five Introduction
Write a function that takes a number x as an input and returns the same value as y, unless x = 5, in which case the function sho...
2ヶ月 前
解決済み
Find out sum and carry of Binary adder
Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition.
Examples
Previo...
2ヶ月 前
解決済み
How many jokers?
* Given DNA codes of a group of suspects,
* and a code for certain types of jokers,
* Count how many jokers of that type.
* ...
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...
2ヶ月 前
解決済み
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...
2ヶ月 前
解決済み
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....
2ヶ月 前
解決済み
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...
2ヶ月 前
解決済み
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...