Community Profile

photo

Matteo Tufi


Last seen: 6 months ago
25 total contributions since 2020

Matteo Tufi's Badges

  • Promoter
  • Leader
  • Solver

View details...

Contributions in
View by

Solved


Cross ("+") flag returns
Given two odd numbers, [m, n], return a matrix of size m x n which has all elements of the centre column and centre row set as 1...

7 months ago

Solved


Upper Matrix Mock
Given a vector v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 0 1 3 6 9; 0 0 1 3 6; 0 0 0 1...

7 months ago

Solved


Separate even from odd numbers in a vector - without loops
*Without using loops*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the...

7 months ago

Solved


Eye Squared
For a positive integer |n| create the identity matrix with |n| elements. In case it is not possible to produce an identity ma...

7 months ago

Solved


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

7 months ago

Solved


Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

7 months ago

Solved


Find the largest value in the 3D matrix
Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...

7 months ago

Solved


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

7 months ago

Solved


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

7 months ago

Solved


Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

7 months ago

Solved


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

7 months ago

Solved


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

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

7 months ago

Solved


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

7 months ago

Solved


Maximum running product for a string of numbers
Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

7 months ago

Solved


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

7 months ago

Solved


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

7 months ago

Solved


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

7 months ago

Solved


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

7 months ago

Solved


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

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

7 months ago

Solved


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

7 months ago

Solved


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

7 months ago

Solved


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

7 months ago

Solved


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

7 months ago