Airline Ticket Mod7 Checksum
There are 13 digits in an airline ticket number. If an airline ticket number is valid, the 13th digit should be the remainder of...
Pentagonal Numbers
Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascen...
3年以上 前
解決済み
Hard limit function
Classify x data as
if x>=0 then y=1
if x<0 then y=0
Example
x = [ -2 -1 0 1 2]
y = [ 0 0 1 1 1]
3年以上 前
解決済み
Polar Form Complex Number Entry
Write a function that takes the magnitude and angle(in degrees) of a complex number and returns a complex variable. Positive ang...
3年以上 前
解決済み
How many unique Pythagorean triples?
For a given integer |n|, return all <https://en.wikipedia.org/wiki/Pythagorean_triple Pythagorean triples> that inlude numbers s...
What gear ratio does the cyclist need?
A cyclist (perhaps including our famed Codysolver the cyclist
<http://www.mathworks.com/matlabcentral/cody/players/1841757-the...
Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input matrix, generate an output matrix that consists o...
4年弱 前
解決済み
Vector to 3-Column Matrix
Consider a vector *A* such as
A = [1 2 3 3 4 5 6]
Can you convert this vector to a three-column matrix like this:
...
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 same order a...
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...
4年弱 前
解決済み
Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the Nth prime nu...
4年弱 前
解決済み
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...
4年弱 前
解決済み
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...
4年弱 前
解決済み
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...