Solved


Sorting integers by their digits (Level 1)
Given a vector, v, of positive integers, return a vector, w, by sorting v in ascending order, such that primary sorting is done ...

meer dan 4 jaar ago

Solved


How Far Can You Throw Something?
As you probably learned in your high school physics class, throwing an object at a 45 degree angle will give you the maximum ran...

meer dan 4 jaar ago

Solved


Vector multiplication
Given two row vectors, v1 and v2, each representing an integer, such that the vector elements are the digits from left to right,...

meer dan 4 jaar ago

Solved


Find unique number in input
Find value that occurs in odd number of input elements.

meer dan 4 jaar 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...

meer dan 4 jaar ago

Solved


Remove collinear points in a set of 2D points defining a polygon
Consider a polygon that is obtained by joining a set of 2D points whose coordinates are stored in matrix P=[x,y]. Write a functi...

meer dan 4 jaar ago

Solved


Simple polynomial evaluation
Compute the value of a polynomial of degree n with all coefficients '1', at value x. n is always n>=0. p(x)=1+x+x^2+...+x^n...

meer dan 4 jaar ago

Solved


Polynomial evaluation
Compute the value of a polynomial of degree n with coeffcients in vector a, at value x. p(x)=a(1)+a(2)x+a(3)x^2+...+a(n+1)x...

meer dan 4 jaar ago

Solved


solve for y that is half as much as three less than one tenth of x
function y = half(x) y = (x * .1); end

meer dan 4 jaar ago

Solved


Iterative sum of digits of 2^n number
Given n, calculate the number 2^n (where n>=0) and *iterate* until the sum of the digits is a single-digit number. Example: ...

meer dan 4 jaar ago

Solved


Split bread like the Pharaohs - Egyptian fractions and greedy algorithm
How would you split 5 loaves of bread among 8 people in all fairness? Get a hint from the Pharaohs. 5/8 = 4/8 + 1/8 , i.e. each ...

meer dan 4 jaar ago

Solved


Maximum of ND-array
Find the maximum element of a N dimensional array. Example: A=[1 2 4 ; -20 4 10]; The maximum is 10.

meer dan 4 jaar ago

Solved


Spherical radius given four points
Determine the radius of a sphere provided four non-coplanar points on the surface of the sphere. pts = [x1 y1 z1; x...

meer dan 4 jaar ago

Solved


Non trivial identities - differentiation
Return x by differentiating it.

meer dan 4 jaar ago

Solved


Non trivial identities - summation
Return x by adding a random number to it.

meer dan 4 jaar ago

Solved


Non trivial identities - reshape
Return x by reshaping it.

meer dan 4 jaar ago

Solved


Non trivial identities - flipping
Return x by flipping it.

meer dan 4 jaar ago

Solved


A shooting competition
In a shooting competition, the target is a square of side L containing a circle of radius R<=L/2. A player scores one point if h...

meer dan 4 jaar ago

Solved


Expand a term
Given a term, as a string, expand it. e. g. f = '2(x + y)';

meer dan 4 jaar ago

Solved


Modulation index
The amplitude of the carrier signal is 2V and the amplitude of the modulating signal is 8V. Find its modulation index.

meer dan 4 jaar 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,...

meer dan 4 jaar ago

Solved


Numerate input arguments
For every string input, output the corresponding number. For example: [a, b] = Test('first', 'second') a=1; b=2;

meer dan 4 jaar ago

Solved


Return the amount of palindromes (words) in the string.
For example: Input: s = 'eye story pop dictionary noon enjoy software moon' Output: amount = 3 Test each word...

meer dan 4 jaar ago

Solved


Text processing - Help Johnny write a letter home from camp
Johnny overuses the word 'great'. Write a script that will help him with this and future letters. If a sentence contains more ...

meer dan 4 jaar ago

Solved


Use R2016b Text Manipulations to Fix These Addresses (Part 3)
We have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma ...

meer dan 4 jaar ago

Solved


Use R2016b Text Manipulations to Fix These Addresses (Part 2)
We have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Mass...

meer dan 4 jaar ago

Solved


Use R2016b Text Manipulations to Fix These Addresses (Part 1)
We have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the...

meer dan 4 jaar ago

Solved


Words Count: A String Array Approach
Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\n), arra...

meer dan 4 jaar ago

Solved


Words Count: A Cell Array Approach
Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\n), arra...

meer dan 4 jaar ago

Solved


Joules to Megatons of TnT
Given joules, J, make a function that converts to megatons of TNT.

meer dan 4 jaar ago

Load more