Solved


Procrustean bed
Given a vector x and an integer n, convert x to a vector of length n by (1) chopping off the end if it is too long, or (2) addin...

10 years ago

Solved


~~~~~~~ WAVE ~~~~~~~~~
|The WAVE generator| Once upon a time there was a river. 'Sum' was passing by the river. He saw the water of the river that w...

10 years ago

Solved


Remove NaNs and numbers adjacent to NaNs
The aim is to remove the elements before and after NaN occurrences inside a vector. For example: x = [6 10 5 8 9 NaN 23 1...

10 years ago

Solved


Help the Patriots get to the Super Bowl
Given a football by the Patriots, return it to them with 2 psi less air in it. (The original psi is passed as a number to the...

10 years ago

Solved


Duplicate a character
Duplicate a character 'n' times. Example 1: str='a' n=5 output='aaaaa' Example 2: str='*' n=3 output='***'

10 years ago

Solved


Slicing the cube
A bored matlab enthusiast has a cube with volume n^3. He decides to paint the entire surface of the cube red. Then, with slices...

10 years ago

Solved


Sort an array of structures
You need to sort an array of structures based upon *a numeric first field*: For example : a.n=1; a.name='a'; b.n=3...

10 years ago

Solved


Wind outward from the center ...
Create an n-by-n matrix with elements ranging from 1 to n^2 in a rectangular spiral pattern. Example if n = 5 : 21 ...

10 years ago

Solved


Possible Outcomes of American Roulette
The payout for American roulette can be calculated by: payout = (38/n)-1 where n is the number of squares the bet covers. ...

10 years ago

Solved


Maintain shape of logical-index mask
When using logical indexing into an array, MATLAB returns a vector output. For example, if A = magic(3); mask = logi...

10 years ago

Solved


Calculate Alcohol By Volume with Original and Final Gravity
Given an initial gravity of un-fermented wort (OG) and a final gravity of fermented wort (FG), better known as beer, it is possi...

10 years ago

Solved


How many days does the cat take to climb out of the hole?
A cat accidentally falls down a hole with sloping but rough sides. It can climb out of the hole of height h metres, but for ever...

10 years ago

Solved


Strange Number Algorithms
Three integer numbers will be provided to you. Write a function to Step1: Multiply first number by 3. Step2: Add 6 with t...

10 years ago

Solved


Simple problem creating a function from an abstract specification.
MYSTERYFUNCTION3 This takes a vector of numbers v and computes a vector w such the w[i] is the average of v[i] and the previous...

10 years ago

Solved


BULLSEYE Part 2: Reference Problem 18 BULLSEYE
Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples: Input ...

10 years ago

Solved


BULLSEYE Part 3: Reference Problem 18 BULLSEYE
Given n (always odd), return output a that has concentric rings of the 69s and 0s around the center point. Examples: Input ...

10 years ago

Solved


Find the number of rectangale
There is a m*n grade given. Find the number of rectangaes in the frid. Remember, a square is also a rectangle.

10 years ago

Solved


Accessing values in a cell
You are given c, which is a 1xN cell array, and a and b, which are each two 1xM vectors. Your job is to give the bth value in t...

10 years ago

Solved


remove nans fast
There are several ways to locate and remove nans in a matrix, and return an 1d row vector. In this problem the challenge is ...

10 years ago

Solved


Find the minimum element of the matrix
Example: If x = [3 9; 5 2] then y = 2

10 years ago

Solved


Compute circular convolution
In signal processing, we usually encounter the circular convolution case. Compute it here using the two input sequences (denoted...

10 years ago

Solved


Find out rooms, peak to peak, average for a square wave.
Find out rms, peak to peak, average for a square wave from peak value. <http://www.rfcafe.com/references/electrical/square-w...

10 years ago

Solved


I want eval
A valid MATLAB statement containing a definition of a vector is passed as a string S. Determine the length of the vector. Inp...

10 years ago

Solved


Create array of all Distances between two Sets of Points
This Challenge is a subsection of <http://www.mathworks.com/matlabcentral/cody/problems/1110-usc-fall-2012-acm-martian-pranks Ma...

10 years ago

Solved


Genome decoding
Inspired by a question on the answer forum: You are given a matrix of 8-bit integers which encodes a genome. Each integer can...

10 years ago

Solved


Whole Number Concatenator
Write a function that concatenates whole numbers. For example: numcat(111,222) should return 111222 numcat(1,2,3,4,5) s...

10 years ago

Solved


N-th digit of Pi
Give the N-th digits of Pi Input = 1 => Output = '1' Input = 1:10 => Output = '1415926535' Input = [11:15 25:35] => Out...

10 years ago

Solved


Probability of Choosing a Red Ball
Given two jars of red and blue balls, find the probability of choosing a red ball from Jar 1 after going through the steps. ...

10 years ago

Solved


Array ex-OR
There are in MATLAB logical functions such as _<http://www.mathworks.co.uk/help/matlab/ref/and.html and>,_ _<http://www.math...

10 years ago

Solved


Largest territory
Determine whose territory is largest. If there are two more large territory, determine a smaller number. For example, X ...

10 years ago

Load more