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 years ago

Solved


Predicting life and death of a memory-less light bulb
*&#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &#128161 &...

8 years ago

Solved


Recaman Sequence - I
Recaman Sequence (A005132 - <http://oeis.org/A005132 - OEIS Link>) is defined as follow; seq(0) = 0; for n > 0, seq(n) ...

8 years ago

Solved


Circle/Pentagon Overlap
Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

8 years ago

Solved


The Glass Half Full
Identical glasses are placed in a triangular tower structure, such that the top level (L = 1) comprises one glass, the next leve...

8 years ago

Solved


Inscribed Pentagon?
Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

8 years ago

Solved


Recaman Sequence - II
Take an arbitrary starting point as input and create Recaman Sequence. Then find the 1, return its index. For example: if n =...

8 years ago

Solved


The Top 5 Primes
This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

8 years ago

Solved


MATLAB Counter
Write a function f = counter(x0,b) to construct a counter handle f that counts with an initial value x0 and a step size b. E...

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

8 years ago

Solved


Sums of Multiple Pairs of Triangular Numbers
This is a follow-up to <https://www.mathworks.com/matlabcentral/cody/problems/44289 Problem 44289> - Find two triangular numbers...

8 years ago

Solved


Breaking Out of the Matrix
Do you want to take the Red Pill, or the Blue Pill? If you take the Blue Pill, you will simply pass along to the next problem...

8 years ago

Solved


ASCII Birthday Cake
Given an age and a name, give draw an ASCII birthday cake. For example, given the name "CODY" and the age 5, return a string wit...

8 years ago

Solved


Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

8 years ago

Solved


5 Prime Numbers
Your function will be given lower and upper integer bounds. Your task is to return a vector containing the first five prime numb...

8 years ago

Solved


Extra safe primes
Did you know that the number 5 is the first safe prime? A safe prime is a prime number that can be expressed as 2p+1, where p is...

8 years ago

Solved


Basic electricity in a dry situation
&#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#...

8 years ago

Solved


Energy of a photon
*&#9883 &#9762 &#9883 &#9762 &#9883 &#9762 &#9883* Given the frequency F of a photon in giga hertz. Find energy E of this...

8 years ago

Solved


Construct an index vector from two input vectors in vectorized fashion
Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

8 years ago

Solved


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

8 years ago

Solved


Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

8 years ago

Solved


Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

8 years ago

Solved


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

8 years ago

Solved


Joining Ranges
You are given a n-by-2 matrix. Each row represents a numeric range, e.g. x = [0 5; 10 3; 20 15; 16 19; 25 25] contains...

8 years ago

Solved


"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

8 years ago

Solved


middleAsColumn: Return all but first and last element as a column vector
Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

8 years ago

Solved


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

8 years ago

Solved


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

8 years ago

Solved


Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

8 years 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 years ago

Load more