Solved

Make roundn function

Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

environ 2 ans ago

Solved

Rounding off numbers to n decimals

Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

environ 2 ans ago

Solved

Matlab Basics - Rounding III

Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

environ 2 ans ago

Solved

Matlab Basics - Rounding II

Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

environ 2 ans ago

Solved

Check that number is whole number

Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...

environ 2 ans ago

Solved

MATLAB Basic: rounding IV

Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

environ 2 ans ago

Solved

MATLAB Basic: rounding III

Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

environ 2 ans ago

Solved

MATLAB Basic: rounding II

Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

environ 2 ans ago

Solved

MATLAB Basic: rounding

Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

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

environ 2 ans ago

Solved

Approximation of Pi

Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

environ 2 ans ago

Solved

Pi Estimate 1

Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

environ 2 ans ago

Solved

Verify Law of Large Numbers

If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

environ 2 ans ago

Solved

Find MPG of Lightest Cars

The file |cars.mat| contains a table named |cars| with variables |Model|, |MPG|, |Horsepower|, |Weight|, and |Acceleration| for ...

environ 2 ans ago

Solved

Longest run of consecutive numbers

Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

environ 2 ans ago

Solved

Volume Pillar

Calculate the volume of a pillar with radius l and heigth ar.

environ 2 ans ago

Solved

Perimeter of a semicircle

Given the diameter d, find the perimeter of a semicircle

environ 2 ans ago

Solved

Given a square and a circle, please decide whether the square covers more area.

You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

environ 2 ans ago

Solved

radius of a spherical planet

You just measured its surface area, that is the input.

environ 2 ans ago

Solved

Calculate area of sector

A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

environ 2 ans ago

Solved

There are 10 types of people in the world

Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...

environ 2 ans ago