43 total contributions since 2017

Born in Shanghai, CN. Master of Finance major, interested in Fixed Income Analysis and Quantitive Financial Analyze. Hobby in MATLAB field are GUI, 3d graph.

Solved

MATLAB Counter

Write a function f = counter(x0,b) to construct a counter handle f that counts with an initial value x0 and a step size b. E...

11 months ago

Solved

Octoberfest festival

A group of students decided to visit Octoberfest festival. First they ordered one beer, then after half-hour they taken one more...

11 months ago

Solved

Spot the First Occurrence of 5

This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

11 months ago

Solved

A Simple Tide Gauge with MATLAB

*∿ ∿ ∿ ∿ ∿ ∿ ∿ ∿* You are standing in a few inches of sea water on a beach. You a...

11 months ago

Solved

Is this is a Tic Tac Toe X Win?

For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M. ...

11 months ago

Solved

5 Prime Numbers

Your function will be given lower and upper integer bounds. Your task is to return a vector containing the first five prime numb...

11 months ago

Solved

Find the nearest prime number

Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

11 months ago

Solved

Circumscribed Pentagon?

Building off of <https://www.mathworks.com/matlabcentral/cody/problems/44368 Problem 44368>, your function will be provided with...

2 years ago

Solved

Hexagonal numbers on a spiral matrix

Put hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements. Formula of hexagonal numbers ...

2 years ago

Solved

Cache me Outside

The test suite includes a simple recursive Fibonacci sequence generator, but it's terribly inefficient. One simple method for im...

2 years ago

Solved

Is this a valid Tic Tac Toe State?

For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M. ...

2 years ago

Solved

Extra safe primes

Did you know that the number 5 is the first safe prime? A safe prime is a prime number that can be expressed as 2p+1, where p is...

2 years ago

Solved

Basic electricity in a dry situation

⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ &#...

2 years ago

Solved

Pentagonal Numbers

Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascen...

2 years ago

Solved

Pernicious Anniversary Problem

Since Cody is 5 years old, it's pernicious. A <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer w...

2 years ago

Solved

Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.

Submit your answer to this problem a multiple of 5 seconds after the hour. Your answer is irrelevant; the only thing that matte...

2 years ago

Solved

Energy of a photon

*⚛ ☢ ⚛ ☢ ⚛ ☢ ⚛* Given the frequency F of a photon in giga hertz. Find energy E of this...

2 years ago

Solved

How to subtract?

*± ± ± ± ± ± ± ± ± ± ±* * Imagine you need to subtract one...

2 years ago

Solved

Recaman Sequence - III

I want to create a Recaman sequence where the nth number will be 1. So from which integer should I start the Recaman sequence? ...

2 years ago

Solved

Parse me a Lisp

*Description* In Lisp and its variants, function calls are done using parenthesis where the first item in the parenthesis is ...

2 years ago

Solved

Group-wise Euclidean distance

*Input*: * *x* —— An array of size *n-by-d*, where each row vector denotes a point in a d-dimensional space; * *g* —— A gro...

2 years ago

Solved

Digit concentration in Champernowne's constant

Consider the first 50 digits of Champernowne's constant 0.12345678910111213141516171819202122232425262728293... The...

2 years ago

Solved

Sums of Distinct Powers

You will be given three numbers: base, nstart, and nend. Write a MATLAB script that will compute the sum of a sequence of both ...

2 years ago

Solved

Tautology

Check if the given expression is always true. For example, the sentence '~(A & B) == (~A | ~B)' is always true. Chara...

2 years ago

Solved

5th Time's a Charm

Write a function that will return the input value. However, your function must fail the first four times, only functioning prope...

2 years ago

Solved

Pair Primes

Let's define pair primes as follow; * *For 2 digits numbers:* 11 and 17 are pair primes because both of them are 2 digits pri...

2 years ago

Solved

Acid and water

⚖ ⚖ ⚖ ⚖ ⚖ ⚖ ⚖ ⚖ Assume that there is a 100 liter tank. It is initially fi...

2 years ago

Solved

An asteroid and a spacecraft

🚀 Imagine a non-relativistic simple situation. Assume positions p0, p1, p2, and p3 are three dimensional Cartesian ...

2 years ago