Solved

Making change
Given an amount of currency, return a vector of this form: [100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01] Example: Input a = ...

8 meses ago

Solved

Create an n-by-n null matrix and fill with ones certain positions
The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

8 meses ago

Solved

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

8 meses ago

Solved

Beads on a Necklace (Convex Hulls)
We may describe a <http://en.wikipedia.org/wiki/Convex_hull convex hull> as a rubber band stretched around a list of points. Som...

8 meses ago

Solved

Spot the outlier
All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

8 meses ago

Solved

Angle between two vectors
You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

8 meses ago

Solved

Calculate the sum of elements of n*n Hilbert matrix.
Calculate the sum of elements of n*n Hilbert matrix. For example, for n=5: HilbertMatrix = [1.0000 0.5000 0.333...

8 meses ago

Solved

Find sum of negative elements in row.
Find sum of negative elements in row. Example x=[1 -5 3 4 -6 6 7 8 9 10] result = -11

8 meses ago

Solved

Convert array of decimal numbers into hexadecimal numbers array.
Convert array of decimal numbers into hexadecimal numbers array. Example x =[ 32 33 34 35 36 37 38 ...

8 meses ago

Solved

Multiply two polynomials p and q given in in vector representation.
Multiply two polynomials p and q given in vector representation. Example p=[-2 0 1 -1 3 2] q=[1 0 -1 2 ...

8 meses ago

Solved

Divide polynomial p1 by p2.
Divide polynomial p1 by p2 given as vectors. Return result q and r vectors which corresponds the quotient and remainder of divis...

8 meses ago

Solved

Select primes from the matrix.
Select primes from the matrix.

8 meses ago

Solved

Octoberfest festival
A group of students decided to visit Octoberfest festival. First they ordered one beer, then after half-hour they taken one more...

8 meses ago

Solved

Temperature conversion
Convert temperature in degrees Celsius (C) to temperature in degrees Kelvin (K). Assume your answer is rounded to the nearest Ke...

8 meses ago

Solved

Don't Try, give up and return NaN.
This is another version of <http://www.mathworks.com/matlabcentral/cody/problems/3107-try-and-catch-simple-example problem 3107....

8 meses ago

Solved

MiniMax
Find the smallest value in array, which is the maximum of its row and column. Example: in array shown below are two numbers w...

8 meses ago

Solved

Narcissistic problem
How many likes has this problem?

8 meses ago

Solved

Polite numbers. Politeness.
A polite number is an integer that sums of two or more consecutive positive integers. Politeness of a positive integer is a num...

8 meses ago

Solved

Polite numbers. N-th polite number.
A polite number is an integer that sums of at least two consecutive positive integers. For example _7 = 3+4_ so 7 is a polite...

8 meses ago

Solved

Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. A <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer w...

8 meses ago

Solved

Find the sides of an isosceles triangle when given its area and height from its base to apex
Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

8 meses ago

Solved

Stuff the Board
You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

8 meses ago

Solved

Simple date to serial no. conversion
Convert a date string to a serial date number. For example if you take x='19-May-2001' then the result is 730990 x...

8 meses ago

Solved

if Slant height of Cone(I)& hight of Cone(H) given then find radius of the Cone(R) for example I=5,h=4 then the ans R=3;

8 meses ago

Solved

Back to basics 4 - Search Path
Covering some basic topics I haven't seen elsewhere on Cody. Return a string that is the user's portion of the current search...

8 meses ago

Solved

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

8 meses ago

Solved

Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

8 meses ago

Solved

Find the nearest integer
Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

8 meses ago

Solved

Five Fingers
A little girl has just learnt how to count from 1 to N using the five fingers of her left hand as follows. She starts by calling...

8 meses ago