Community Profile

# Peiyi Yao

##### Last seen: 20 días ago
756 total contributions since 2015

View details...

Contributions in
View by

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

alrededor de 1 mes 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...

alrededor de 1 mes ago

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

alrededor de 2 meses ago

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

alrededor de 2 meses ago

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

alrededor de 2 meses ago

Solved

Find square of given number
Find Square of any number

8 meses ago

Solved

Square root of number
Square root of given number.

8 meses ago

Solved

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

8 meses ago

Solved

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

8 meses ago

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

8 meses ago

Solved

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

8 meses ago

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

8 meses ago

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;

8 meses ago

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

8 meses ago

Solved

Square
square root of x

8 meses ago

Solved

factorial
calculate x!

8 meses ago

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]

8 meses ago

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)

8 meses ago

Solved

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

8 meses ago

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

8 meses ago

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

8 meses ago

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

8 meses ago

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]

8 meses ago

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

8 meses ago

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

8 meses ago

Solved

Element-wise vector product
Given two vectors x and y, compute their element-wise product z. Thus, if x = [1 3 5] and y = [0.5 -1 2], then z = [1*0.5...

8 meses ago

Solved

Vector raised to a power (element-wise)
Given a vector A and a number x, raise each element of the vector to the power of x. Thus, if A = [2 5 7 1] and x = 0.5, then ...

8 meses ago

Solved

MinMax
* x=[2 4 3 1 6 4 6] * output , y=[1 6 2 4 3] here,y(1) is the minimum of x, y(2) is the maximum of x, y(3) is the 2nd mini...

8 meses ago

Solved

Sum! Sum! Sum!
Calculate the sum of the sequence up to nth term >> a,aa,aaa,aaaa,... 2,22,222,2222,... [for a=2]

8 meses ago

Solved

Find 0 in array
Given array find where there 0 is.

8 meses ago