Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Mehr laden