Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

9ヶ月 前

Matrix Transposition
Given a matrix and an index, perform matrix transposition as follows - Replace non-corner value of ith ring from outside, with...

9ヶ月 前

Multiples of a Number in a Given Range
Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

9ヶ月 前

Smith numbers
Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at <http://en.wikipedi...

9ヶ月 前

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

9ヶ月 前

Converting binary to decimals
Convert binary to decimals. Example: 010111 = 23. 110000 = 48.

9ヶ月 前

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

9ヶ月 前

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

9ヶ月 前

Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

9ヶ月 前

Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

9ヶ月 前

Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

9ヶ月 前

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

9ヶ月 前

Convert given decimal number to binary number.
Convert given decimal number to binary number. Example x=10, then answer must be 1010.

9ヶ月 前

Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

9ヶ月 前

Determine whether the input is an anagram number
In Cody Problem 44293, Mehmet OZC asks us to spell numbers as words. For example, 67 would be “sixty-seven” and 76 would be “sev...

9ヶ月 前

String Logic 11
Examples: 'SUNDAY' --> 6 'MONDAY' --> 6 'TUESDAY' --> 7 'WEDNESDAY' --> 9 'THURSDAY' --> 8 'FRIDAY' --> 5 'SATURDAY' --...

9ヶ月 前

Backgammon #4 - Dice Probabilities
Previous problems in this series have looked at how a backgammon board might be represented, and board positions manipulated and...

9ヶ月 前

Find the Pattern 10

9ヶ月 前

Find the Pattern 9

9ヶ月 前

Find the Pattern 8

9ヶ月 前

Find the Pattern 7

9ヶ月 前

Handle to an array of functions
Given a cell array of functions that operate on scalars, it is required to return a function handle to process a vector of value...

9ヶ月 前

Apply a function array to an array of numbers
It is required to apply a cell array of functions to a numerical array, where the functions accept only scalar inputs. Exampl...

9ヶ月 前

Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

9ヶ月 前

Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

9ヶ月 前

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

9ヶ月 前

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

9ヶ月 前

Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

9ヶ月 前

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

9ヶ月 前

Convert a Cell Array into an Array
Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

9ヶ月 前