Community Profile

# zhenyu

Last seen: 3 giorni fa Attivo dal 2022

Visualizza badge

#### Content Feed

Visto da

Risolto

Simple equation: Annual salary
Given an hourly wage, compute an annual salary

3 mesi fa

Risolto

Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

3 mesi fa

Risolto

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

3 mesi fa

Risolto

Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

3 mesi fa

Risolto

Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

3 mesi fa

Risolto

Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

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

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

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

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

Draw a '0' in a one matrix!

3 mesi fa

Risolto

Find the next Fibonacci number
In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

3 mesi fa

Risolto

Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

3 mesi fa

Risolto

Find the maximum number of decimal places in a set of numbers
Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

3 mesi fa

Risolto

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

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

3 mesi fa

Risolto

Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...

3 mesi fa

Risolto

Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

3 mesi fa

Risolto

Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

3 mesi fa

Risolto

Create a vector
Create a vector from 0 to n by intervals of 2.

3 mesi fa

Risolto

Get the length of a given vector
Given a vector x, the output y should equal the length of x.

3 mesi fa

Risolto

Return area of square
Side of square=input=a Area=output=b

3 mesi fa