문제를 풀었습니다


Double Fibonacci
double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the inpu...

거의 5년 전

문제를 풀었습니다


Sort Except Zeros
Sort the numbers in a vector. But the position of zeros should not be changed. Example: sort_except_zeros( [5 3 0 0 2 4] ) == [...

거의 5년 전

문제를 풀었습니다


Find the nth composite number.
Everyone heard about the nth prime number. Let's try to find out the nth composite. For example , 1 is the first composite, 10 i...

거의 5년 전

문제를 풀었습니다


Get to a number faster.
If you start with $1 and, with each move, you can either double your money or add another $1, what is the smallest number of mov...

거의 5년 전

문제를 풀었습니다


Find the number of days in a given year
Given a year number (eg. 2000) as input, find how many days are there in the given year.

거의 5년 전

문제를 풀었습니다


The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...

거의 5년 전

문제를 풀었습니다


Determine the average number of rounds for the following game.
Each round a uniformly distributed random number is picked between 0 and 1. The game ends when the sum of the random numbers is ...

거의 5년 전

문제를 풀었습니다


Right shift an array n times with constant space.
Right shift an array n times with constant space, that is, no extra array can be used. Right shift operation: Last element com...

거의 5년 전

문제를 풀었습니다


Vector creation using linspace
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use linspace.

거의 5년 전

문제를 풀었습니다


Vector creation using colon operator
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use the colon (:) operator.

거의 5년 전

문제를 풀었습니다


Logarithmically spaced vector creation using logspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Use the logspace operator.

거의 5년 전

문제를 풀었습니다


Logarithmically spaced vector creation using linspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Avoid using logspace and use the linsp...

거의 5년 전

문제를 풀었습니다


Stacking vectors into a matrix
Given a 4x1 vector a, and a 2x2 matrix b, create a matrix M in which the first 2 rows are each identical to a and the last two r...

거의 5년 전

문제를 풀었습니다


Identify Ruth-Aaron numbers
After Hank Aaron hit his 715th home run and passed Babe Ruth’s total of 714, Carl Pomerance noticed that the union of the prime ...

거의 5년 전

문제를 풀었습니다


Matrix convolution
A certain convolution step involves an elementwise multipication between two 3x3 matrices and taking the resulting sum of the el...

거의 5년 전

문제를 풀었습니다


Matrix Indexing
Given a matrix A and scalars r,c,i, find the product of two elements, with the first element located at row r and column c (doub...

거의 5년 전

문제를 풀었습니다


MATLAB Basics: Complex Numbers
For a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].

거의 5년 전

문제를 풀었습니다


Compute the fractional derivative
Cody Problem 1370 asks us to compute the derivative of a polynomial. This problem extends that idea to fractional derivatives, w...

거의 5년 전

문제를 풀었습니다


Compute the sum of reciprocals of quadratics
Write a function to compute the following sum: See also Cody Problem 46000.

거의 5년 전

문제를 풀었습니다


MATLAB Basics: Complex Conjugates
For a given complex number, x, return the complex conjugate, y.

거의 5년 전

문제를 풀었습니다


MATLAB Basics: Complex Argument
For a given complex number, x, return the argument, y, in degrees.

거의 5년 전

문제를 풀었습니다


Peg Solitaire - Apply Move
About Peg Solitaire . Previous Problem. Consider inital board; If we move the peg located on (4,6) to the left (4) directio...

거의 5년 전

문제를 풀었습니다


Peg Solitaire - Get Possible Moves
About Peg Solitaire. Consider following initial board; (1) indicates there is a peg and (0) indicates empty holes. For thi...

거의 5년 전

문제를 풀었습니다


Create a function that gives a matrix like the following
x=3 y= [1 -1 -1 0 1 -1 0 0 1]; -------------------------------- x=5 y= [ 1 -1 -...

거의 5년 전

문제를 풀었습니다


Roman numbers: how old is that building?
The front of old buildings sometimes show the year when they were built in roman numbers. These number are rather confusing and ...

거의 5년 전

문제를 풀었습니다


Draw matrix 'Swiss flag'( Euro 2020)
Draw a x-by-x matrix 'Swiss flag' using '1' and 0.(x is odd and bigger than 4) Example x=5 ans = [1 1 1 1 ...

거의 5년 전

문제를 풀었습니다


Minimum jumps to reach end of the array
Given an array of integers where each element represents the max number of steps that can be made forward from that element. Ste...

거의 5년 전

문제를 풀었습니다


Generate a matrix as follows
write a Function that gives like the following for a random n: n=2 ans= [ 0 1 1 0] n=6 ans= [ 0 ...

거의 5년 전

문제를 풀었습니다


Draw a x-by-x matrix 'Denmark flag'(Euro(2020)
Draw a x-by-x matrix 'Denmark flag' using '4' and '1'.(x is odd and bigger than 4) Number 4: Caption S.Kjær and number 1: K.S...

거의 5년 전

문제를 풀었습니다


Find numbers in the Popular Computing Z-sequence
Here’s a quick one. In 1977 the magazine Popular Computing sought “problem situations for which the computer is the best (if not...

거의 5년 전

더 보기