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

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

7 years ago

Solved


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

7 years ago

Solved


Getting the indices from a matrice
Getting the indices from a matrice. Inspired by Problem 645. Getting the indices from a vector by the great Doug Hull. Given a...

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

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

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

7 years ago

Solved


intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

7 years ago

Solved


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

7 years ago

Solved


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

7 years ago

Solved


The sliding puzzle: 3D
This is an extension of <https://www.mathworks.com/matlabcentral/cody/problems/42842 problem 42842>. In this case, the puzzle is...

8 years ago

Solved


Pandigital Multiples of 11 (based on Project Euler 491)
A "Pandigital number of order X" is one that contains all of the numbers from 0 to X, but with no leading zeroes. If X>9, the cy...

8 years ago

Solved


Parse me a Lisp
*Description* In Lisp and its variants, function calls are done using parenthesis where the first item in the parenthesis is ...

8 years ago

Solved


Cache me Outside
The test suite includes a simple recursive Fibonacci sequence generator, but it's terribly inefficient. One simple method for im...

8 years ago

Solved


Inscribed Pentagon? 2
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


Is this a valid Tic Tac Toe State?
For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M. ...

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


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


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


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


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


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


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


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


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


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


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


A Simple Tide Gauge with MATLAB
*&#8767 &#8767 &#8767 &#8767 &#8767 &#8767 &#8767 &#8767* You are standing in a few inches of sea water on a beach. You a...

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

Load more