Solved


Matrix game: Winner takes all
Given a matrix A, return a new matrix of the same size in which the biggest element of each column in A takes 1, and 0 for all t...

2 years ago

Solved


X O X O
On a noughts and crosses board, how many possible unique combinations are there given a square grid of length n? Assumptions/...

2 years ago

Solved


Matrix indexing with two vectors of indices (★★)
(copy of Prob 589) Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)). Thus, if...

2 years ago

Solved


Remove the row average (★★★)
(copy of Prob. 963) Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solut...

2 years ago

Solved


pizza deals
Given two pizza slices of different sizes: * Slice A with angle alpha1, radius r1, and price p1 * Slice B with angle alpha2,...

2 years ago

Solved


Find the outcast
All pairs have the same difference except for one. Output the index of the latter Example: input =[0 1; 1 0; ...

2 years ago

Solved


Sum! Sum! Sum!
Calculate the sum of the sequence up to nth term >> a,aa,aaa,aaaa,... 2,22,222,2222,... [for a=2]

2 years ago

Solved


Visualization of experimental data across a surface
Assume that you have taken data across the surface of a sample, for example sheet resistance. The data is stored in a Nx3 matri...

2 years ago

Solved


Matrix diagonalization
You will be given Two matrices A and B. Return 1 if B is the diagonal matrix of A, 0 otherwise

2 years ago

Solved


Implement the signum function
The signum function is a common mathematical function, which has the following definition : If x => 0, its value is 1, if x < 0...

2 years ago

Solved


Bleed non-zeros to the right
What a title! Yet, it says what I mean. You get a vector, some values and a lot of zeroes. Every zero is replaced by the firs...

2 years ago

Solved


Higher! Lower!
My kids have started to play the "I'm thinking of a number between X and Y" game in the car on trips to and from their swim less...

2 years ago

Solved


Monty Hall
The classic Monty Hall "Let's Make a Deal" final showcase puzzle pits the contestant against three Doors. Behind one Door are dr...

2 years ago

Solved


Flow rate in a pipe

2 years ago

Solved


McCabe Complexity
The Challenge is to return the McCabe complexity for various functions. One way to determine the McCabe Complexity is to use ...

2 years ago

Solved


Compute Farey sequences
Problem statement The Farey sequence of order consists of fractions between 0 and 1 expressed in reduced form in increasing or...

2 years ago

Solved


Compute a sum
Write a function to compute the following sum Although a solution is available for general values of the coefficients, the co...

2 years ago

Solved


Calculating the Union Area of Overlapping Rectangles
Calculate the area covered by a union of multiple rectangles. Each rectangle is represented by 4 integers: the first two integer...

2 years ago

Solved


How to locate the position of an element in a vector without using the find function
(copy of prob 105 with test for find function) Write a function posX = *locatePos* (x,y) which returns the location o...

2 years ago

Solved


Function Sniffer
Given a string, find out which built-in functions are present, output a simple string, that has sorted and unique list of the...

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

2 years ago

Solved


Musical Note Interval 1 - Diatonic Scale
Assuming a simple diatonic C scale, calculate the interval (integer) between two notes (provided as strings). By applying number...

2 years ago

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for.

2 years ago

Solved


Mo money, mo math #2! (★★★)
(adapted from Prob 9 Cody team) You have a matrix for which each row is a person and the columns represent the number of quar...

2 years ago

Solved


Get the combinations
Consider p,q = 2 vectors of same or different length. Get a Output Array which has all the possible combinations of Elements o...

2 years ago

Solved


Return the sequence element II
Given positive integers x and n, return a positive integer, y, which is the nth term in the <https://en.wikipedia.org/wiki/Juggl...

2 years ago

Solved


Create array of all Distances between two Sets of Points
This Challenge is a subsection of Martian Pranks based on Tim's efficient Distance calculation between sets of points. Given Po...

2 years ago

Solved


Distance Between Points
Being n the number of points (If n = 3 there would be 3 points: A, B and C). The distance between each pair of points increases...

2 years ago

Solved


Pairwise column flip
Given matrix *M_in*, flip every pair of columns. So if *M_in* is 1 2 3 4 1 2 3 4 then *M_out* is 2 1 4 3 2 1 4 3 ...

2 years ago

Load more