Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...
Get all prime factors
List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...
Convert to Binary Coded Decimal
Convert from decimal representation to <http://en.wikipedia.org/wiki/Binary-coded_decimal Binary Code Decimal> (or BCD) represen...
約4年 前
解決済み
Find out magnitude of vector
Find out magnitude of vector.
Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2)
Please don't use sum function.
If you l...
Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...
約4年 前
解決済み
multiply by three
Given the variable x as your input, multiply it by 3 and put the result equal to y.
Examples:
Input x = 2
Output y is ...
約4年 前
解決済み
Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...
約4年 前
解決済み
Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody.
Return the class of the input variable.