Community Profile

# Peiyi Yao

##### Last seen: 3 dagar ago
760 total contributions since 2015

View details...

Contributions in
View by

Solved

Matrix Pattern 1

5 dagar ago

Solved

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

6 dagar ago

Solved

Generalised Hamming Number
Inspired by Project Euler n°204 and Problem 1308 by James A generalised Hamming number of type n, has no prime factor larger ...

6 dagar ago

Solved

~~~~~~~ WAVE ~~~~~~~~~
|The WAVE generator| Once upon a time there was a river. 'Sum' was passing by the river. He saw the water of the river that w...

7 dagar ago

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

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

Solved

Rotate input square matrix 90 degrees CCW without rot90
Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

Solved

How many Integers?
Count the integers in a given vector |v|. You *must* use a loop to count each element separately. Examples: Input: v...

Solved

Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

Solved

Find square of given number
Find Square of any number

Solved

Square root of number
Square root of given number.

Solved

Triangle???
Calculate the circumference of an equilateral triangle with x

Solved

Sum Sum Sum!
Calculate the sum of the natural numbers from 1 to n

Solved

Double Factorial
Return double factorial n(n-2)...(5)(3)(1), n>0, odd n!! = n(n-2)...(6)(4)(2), n>0, even 1 ...

Solved

Calculate the area of a circle
Given a circle of diameter x calculate its area

Solved

given three inputs (a, b, c) for the equation a*x^2+b*x+c=0; return 1 if the roots are complex (non zero imaginary), and 0 if th...

Solved

Check prime numbers
Let x, return 1 if x is a prime number, 0 otherwise e.g x = 7, return y =1; x = 6 return y = 0;

Solved

Summing Rows and Columns
Create a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last...

Solved

Square
square root of x

Solved

factorial
calculate x!

Solved

Repeat elements of a vector
Repeat each elements of a given vector according to their values. * x=[1,2,1,3] * y=[1,2,2,1,3,3,3]

Solved

Sum of series
a(n) = n^2 - (n-1)^2 find the summation of the series upto n i.e. a(1)+a(2)+...+a(n)

Solved

Product of a and b
return the value of c = a*b

Solved

Create a vector of the first n odd numbers
If n = 10, your program should return a vector y, where y = [1 3 5 7 9 11 13 15 17 19].

Solved

Create a vector of n alternating ones and zeros
Given n, your output should be a vector y of numnbers such that the first number is 1 and the numbers following it alternate bet...

Solved

Generate n equally spaced "intervals" between -x and x
Given n and x, return a list of numbers (in ascending order) that divides the interval [-x x] into n equal-length intervals. ...

Solved

Create a vector with n repeated values of a number x
If x=3 and n=7 then the vector y would be y=[3 3 3 3 3 3 3]

Solved

Create a vector of the first n naturnal numbers
If n = 7, your program should return a vector y, where y = [1 2 3 4 5 6 7].

Solved

Create logarithmically spaced values
Given three numbers a,b,n with b>a, create a vector y with n logarithmic spaced values between 10^a and 10^b. Thus, if a = -2, ...