Solved


Generalized sorting
Write generalized sort function |sortg()| that sorts array elements in “ascending” order with given comparison funct...

12 years ago

Solved


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

12 years ago

Solved


Triangle Numbers Below N
This is an offshoot of <http://www.mathworks.com/matlabcentral/cody/problems/5-triangle-numbers Cody Problem 5: Triangle Numbers...

12 years ago

Solved


Infernal Recursion
Consider the recursion relation: x_n = (x_(n-1)*x_(n-2))^k Given x_1, x_2, and k, x_n can be found by this definition. Wr...

12 years ago

Solved


Construct a string from letters and counts
Given two input arrays like this: [5,3,1] ['a','b','c'] Output a string that contains each letter the specified num...

12 years ago

Solved


collision
several cars (n) were involved in this collision, the input matrix (vm) has n rows and two columns, first column for velocity an...

12 years ago

Solved


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

12 years ago

Solved


Return the Nth Output from an Input Command
*Description* Given _F_, a cell array whose first element is a function handle and subsequent elements are arguments, return ...

12 years ago

Solved


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

12 years ago

Solved


Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

12 years ago

Solved


Boolean algebra
Your contractor from Elbonia has sent you the prototype of the new logical unit. It turns out that the only logical relation it ...

12 years ago

Solved


Nonuniform quantizer as a piecewise constant function
Implement a nonuniform quantizer as the following piecewise function: y = -3.5, x < 3 y = -1.5, -3 &#8804; x < -1 y = -...

12 years ago

Solved


Find the "ordinary" or Euclidean distance between A and Z
A, B and Z define three points in the 3D _Euclidean_ space of the form: A = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z]; Find th...

12 years ago

Solved


Scrabble Scores
Given a word, determine its score in <http://en.wikipedia.org/wiki/Scrabble Scrabble>. The input string will always be provide...

12 years ago

Solved


Create a function handle that reverses the input arguments of another function handle
Given a function that takes two input arguments and returns one output, create another function handle that performs the same op...

12 years ago

Solved


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

12 years ago

Solved


Four quadrant inverse tangent function.
Create a function that returns an array P the same size as X and Y containing the element-by-element, four-quadrant inverse tang...

12 years ago

Solved


Project Euler: Problem 16, Sums of Digits of Powers of Two
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

12 years ago

Solved


Make an N-dimensional Multiplication Table
*INSTRUCTIONS* This is a multi-dimensional variant of the normal multiplication table used to teach elementary students multi...

12 years ago

Solved


Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

12 years ago

Solved


Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

12 years ago

Solved


Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

12 years ago

Solved


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

12 years ago

Solved


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

12 years ago

Solved


Make a function that returns its own character count
Write a function that returns a 128 element vector with an accurate inventory of the ASCII characters in its own function file. ...

12 years ago

Solved


Twins in a Window
<http://en.wikipedia.org/wiki/Twin_primes Twin primes> are prime numbers that differ by 2, such as [11,13] or [41,43]. Write a f...

12 years ago

Solved


Project Euler: Problem 8, Find largest product in a large string of numbers
Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

12 years ago

Solved


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

12 years ago

Solved


Fizz Buzz
Given an array of positive, non-zero, integers, return a cell array of strings the same size as the input, where each element in...

12 years ago

Solved


Project Euler: Problem 5, Smallest multiple
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smalle...

12 years ago

Load more