Converting Decimal to Binary
Given a decimal number that may include a fractional component, convert it into binary representation. The numbers you are given...
5年弱 前
解決済み
Church Encoding
Church encoded numeral is a function which takes two arguments _f_ and _x_ and applies _f_ to _x_ several times.
For example,...
5年弱 前
解決済み
calculate PI without using pi function
There are many methods to get the pi(Ratio of circumference to diameter).
You should get pi without using the pi function in M...
5年弱 前
解決済み
Negative without '-'
Simple: return a negative number without using the '-' sign.
Thanks to Problem <https://www.mathworks.com/matlabcentral/cody/...
Determinant without using det()
Given a square matrix A, compute the <http://en.wikipedia.org/wiki/Determinant determinant> of A.
Note that you may not use t...
5年弱 前
解決済み
Airline Ticket Mod7 Checksum
There are 13 digits in an airline ticket number. If an airline ticket number is valid, the 13th digit should be the remainder of...
5年弱 前
解決済み
Array ex-OR
There are in MATLAB logical functions such as
_<http://www.mathworks.co.uk/help/matlab/ref/and.html and>,_
_<http://www.math...
5年弱 前
解決済み
Number of even divisors of a given number
Given a Number n, return the number of its even divisors without listing them.
example:
n=14 ; EvenDivisors={2,14} ; y=2
...
5年弱 前
解決済み
Choose the best fitting dominoes
You will be given a cell array of nx2 matrices. Choose one row from each matrix. These are the ordered pairs that will be plac...
5年弱 前
解決済み
Find best domino orientation
Given a list of pairs, find the orientation they should be placed in a line, such that the sum of the absolute values of the dif...
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...
5年弱 前
解決済み
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...
5年弱 前
解決済み
7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: <http://...
5年弱 前
解決済み
Convert Roman to Arabic Numerals
Based upon what I see on tv and at the movies, the use of Roman numerals indicates something is important or sophisticated (e.g....
5年弱 前
解決済み
Math with Roman Numerals
Given a function R within (+,-,*,/) and two Roman numerals a & b, compute aRb in Roman numerals.
Calculate the sum of two polynomials
Calculate the sum of two polynomials if they are written in notation with their coefficients.
example:
a=[3 4 5];
b=[...
5年弱 前
解決済み
Moving average (variable kernel length)
Find the moving average in a vector. The kernel length is a variable.
For example
x = 1:10
kernel_length = 2
would r...