Community Profile

# Riccardo Bonomelli

Last seen: 1 día ago Active since 2019

All

#### Content Feed

View by

Solved

Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

7 meses ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

12 meses ago

Solved

Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

12 meses ago

want to solve (d^2 y)/(dx^2 )+dy/dx-6y=0 using 4th order Runge-Kutta method with y(0) = 3 and y’(0) = 1
Hi, the problem seems to be in the definition of the function f, you defined f as a single variable function or f(x) while, acco...

más de 1 año ago | 0

Help to optimize the execution time of this function, modifying the entries of a matrix (GPU? Parallel CPU?).
Hi Thomas, the easiest procedure to implement to speed up the execution is to generate a MEX file of your function using the Mat...

más de 1 año ago | 1

Question

Plotting triangulation with variables defined at the barycenter
I have created a triangulation of a 2D space, here reported you can see it: On such triangulation I have perfomed some calcul...

más de 1 año ago | 0 answers | 0

### 0

Solved

frame of the matrix
Given the matrix M, return M without the external frame.

alrededor de 2 años ago

Solved

Wheat on a chessboard pt 1
If a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successi...

más de 2 años ago

Solved

The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

casi 3 años ago

Solved

Is my wife right?
Regardless of input, output the string 'yes'.

casi 3 años ago

Solved

Largest Twin Primes
<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

casi 3 años ago

Solved

Find the next prime number
Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

casi 3 años ago

Solved

Make a vector of prime numbers
Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

casi 3 años ago

Solved

Find nearest prime number less than input number
Find nearest prime number less than input number. For example: if the input number is 125, then the nearest prime number whi...

casi 3 años ago

Solved

Mersenne Primes vs. All Primes
A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

casi 3 años ago

Solved

Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

casi 3 años ago

Solved

First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

casi 3 años ago

Solved

Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

casi 3 años ago

Solved

Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

casi 3 años ago

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

casi 3 años ago

Solved

Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

casi 3 años ago

Solved

Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

casi 3 años ago

Solved

Sophie Germain prime
In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

casi 3 años ago

Solved

The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

casi 3 años ago

Solved

Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

casi 3 años ago

Solved

Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

casi 3 años ago

Solved

Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

casi 3 años ago

Solved

Inner product of two vectors
Find the inner product of two vectors.

casi 3 años ago

Solved

Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

casi 3 años ago

Solved

Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

casi 3 años ago