Solved


PEMDAS 101
Return the following results for scalar values a,b,c,d.

5 years ago

Solved


Cylinder volume
The volume V of a cylinder with radius r and height h is given by . Three cylinders are provided with radius r = [r1, r2, r3] ...

5 years ago

Solved


Logarithmically spaced vector creation using linspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Avoid using logspace and use the linsp...

5 years ago

Solved


Logarithmically spaced vector creation using logspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Use the logspace operator.

5 years ago

Solved


Vector creation using colon operator
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use the colon (:) operator.

5 years ago

Solved


Vector creation using linspace
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use linspace.

5 years ago

Solved


Function composition - harder
Write a function that accepts an arbitrary number of function handles f_1, f_2, ..., f_n and returns the composition h. That is,...

5 years ago

Solved


Create a patchwork matrix
This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

5 years ago

Solved


Polarisation
You have n polarising filters stacked one on top of another, and you know each axis angle. How much light gets passed through th...

5 years ago

Solved


Right shift an array n times with constant space.
Right shift an array n times with constant space, that is, no extra array can be used. Right shift operation: Last element com...

5 years ago

Solved


Prime Product
My professor has given a sequence of N numbers as a1, a2, ..., aN and asked me to find the smallest possible value of ai * aj su...

5 years ago

Solved


Spiral In
Create an m by n matrix filled with sequential integers starting from 1 and arranged in a counterclockwise spiral that hugs the ...

5 years ago

Problem


Compute a sum of Ramanujan
Srinivasa Ramanujan defined the following function: Write a function to compute for various values of . See also Cody Proble...

5 years ago | 3 | 19 solvers

Solved


Accumulate Cells
Given a combining function, a cell array, and an initial value, accumulate the result. For example, accumcell(@plus,{1,...

5 years ago

Solved


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

5 years ago

Solved


Connect Four - 01
Connect four is a two player board game. <https://en.wikipedia.org/wiki/Connect_Four> Given a complete connect-four board,...

5 years ago

Solved


Determine the average number of rounds for the following game.
Each round a uniformly distributed random number is picked between 0 and 1. The game ends when the sum of the random numbers is ...

5 years ago

Solved


preventing a war!!
essume you are a student and your family paid a lot of money for your classes but unfortunately the online classes made you a ...

5 years ago

Solved


Function - Cylinder Surface Area
The goal

5 years ago

Solved


$10,000 sequence
Find the nth term of the Hofstadter–Conway sequence and its chaotic cousin. <https://en.wikipedia.org/wiki/Hofstadter_sequenc...

5 years ago

Solved


Molecule Atomic Wt (CHONS) Molecules
Given a molecular equation string determine its atomic weight. Limited atoms of C H O N and S where wts are rounded to [12 1 ...

5 years ago

Problem


Find the smallest integer m such that n divides m!
Write a function that takes an integer and finds the smallest integer whose factorial is divisible by . For example, if , then...

5 years ago | 4 | 19 solvers

Solved


Best Problem Elections
When I am writing those words, there are 2002 problems on Cody. Many of them are simply wonderful. Do you remember which of them...

5 years ago

Solved


Create nXn Fourier matrix

5 years ago

Solved


Find the number of days in a given year
Given a year number (eg. 2000) as input, find how many days are there in the given year.

5 years ago

Solved


Aquiles y la tortuga
Contaba Zenón en su famosa paradoja que un día Aquiles, el guerrero griego más veloz de la Hélade, se enfrentó a una pequeña tor...

5 years ago

Solved


Return the names and values of the input arguments of a function
Given a function name, return the names and values of the input arguments. e.g. function_name(arg1, arg2) is a function de...

5 years ago

Solved


Find offset of an element of a multi dimensional matrix
For a given multi dimensional matrix and given element, find its offset from the 1st element. Return 0, if element is not fo...

5 years ago

Solved


Find offset of given matrix element from first matrix element
Given matrix m and an element of that matrix, return the offset from its first element. e.g. m=[11 2 34; 40 51 6; 87 8 109] el...

5 years ago

Load more