Risolto

Inscribed Pentagon?

Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

oltre 3 anni fa

Risolto

Construct an index vector from two input vectors in vectorized fashion

Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

oltre 3 anni fa

Risolto

Joining Ranges

You are given a n-by-2 matrix. Each row represents a numeric range, e.g. x = [0 5; 10 3; 20 15; 16 19; 25 25] contains...

oltre 3 anni fa

Risolto

Put two time series onto the same time basis

Use interpolation to align two time series onto the same time vector. This is a problem that comes up in <http://www.mathwork...

oltre 3 anni fa

Risolto

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

oltre 3 anni fa

Risolto

Return a list sorted by number of consecutive occurrences

Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

oltre 3 anni fa

Risolto

Create logical matrix with a specific row and column sums

Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

oltre 3 anni fa

Risolto

Get the elements of diagonal and antidiagonal for any m-by-n matrix

In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

oltre 3 anni fa

Risolto

Getting the indices from a matrice

Getting the indices from a matrice. Inspired by Problem 645. Getting the indices from a vector by the great Doug Hull. Given a...

oltre 3 anni fa

Risolto

middleAsColumn: Return all but first and last element as a column vector

Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

oltre 3 anni fa

Risolto

Return elements unique to either input

Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

oltre 3 anni fa

Risolto

Return unique values without sorting

If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

oltre 3 anni fa

Risolto

"Low : High - Low : High - Turn around " -- Create a subindices vector

Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

oltre 3 anni fa

Risolto

Specific Element Count

Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

oltre 3 anni fa

Risolto

Matrix indexing with two vectors of indices

Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

oltre 3 anni fa

Risolto

Remove the two elements next to NaN value

The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

oltre 3 anni fa

Risolto

Getting logical indexes

This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

oltre 3 anni fa

Risolto

The Top 5 Primes

This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

oltre 3 anni fa

Risolto

Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.

Submit your answer to this problem a multiple of 5 seconds after the hour. Your answer is irrelevant; the only thing that matte...

oltre 3 anni fa

Risolto

Circular Primes (based on Project Euler, problem 35)

The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

oltre 3 anni fa

Risolto

Find nearest prime number less than input number

Find nearest prime number less than input number. For example: if the input number is 125, then the nearest prime number whi...

oltre 3 anni fa

Risolto

Sophie Germain prime

In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

oltre 3 anni fa

Risolto

Make a vector of prime numbers

Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

oltre 3 anni fa

Risolto

Largest Twin Primes

<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

oltre 3 anni fa

Risolto

Find the next prime number

Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

oltre 3 anni fa

Risolto

Mersenne Primes vs. All Primes

A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

oltre 3 anni fa

Risolto

The Goldbach Conjecture

The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

oltre 3 anni fa

Risolto

Mersenne Primes

A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

oltre 3 anni fa

Risolto

Convert matrix to 3D array of triangular matrices

Given a 2D numeric array x in which each column represents the vectorized form of an upper triangular matrix, return a 3D array ...

oltre 3 anni fa

Risolto

MatCAT - Reconstruct X from Its X-rays

Consider a matrix x x = [ 1 2 0 0 5 0 3 0 8 ] If we sum x along the rows we get row_sums = [3 5 11] ...

oltre 3 anni fa