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

6 mois ago

Solved

Inscribed Pentagon? 2

Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

presque 2 ans 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. ...

presque 2 ans 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...

presque 2 ans 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 ...

presque 2 ans ago

Solved

Circumscribed Pentagon?

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

presque 2 ans 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...

presque 2 ans ago

Solved

Digit concentration in Champernowne's constant

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

presque 2 ans ago

Solved

An asteroid and a spacecraft

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

presque 2 ans 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 ...

presque 2 ans ago

Solved

Number of Even Elements in Fibonacci Sequence

Find how many even fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

presque 2 ans 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...

presque 2 ans ago

Solved

Acid and water

Assume that there is a 100 liter tank. It is initially filled with just distilled water. It is continuously drained at R...

presque 2 ans ago

Solved

"Cody" * 5 == "CodyCodyCodyCodyCody"

*Alice*: What? *"Cody" * 5 == "CodyCodyCodyCodyCody"*? You've gotta be kidding me! *Bob*: No, I am serious! Python supports...

presque 2 ans ago

Solved

How to subtract?

* Imagine you need to subtract one number from another using MATLAB. * You will not be using eval for this task. * Given two A...

presque 2 ans ago

Solved

The 5th Root

Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

presque 2 ans ago

Solved

Pizza!

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

presque 3 ans ago

Question

Values in function handle (this worked for inline...)

I want to create sets of random linear functions: m*x+b for many different m values and b values. I used to do something like th...

environ 5 ans ago | 1 answer | 0