Risolto


Find best domino orientation
Given a list of pairs, find the orientation they should be placed in a line, such that the sum of the absolute values of the dif...

1 giorno fa

Risolto


Choose the best fitting dominoes
You will be given a cell array of nx2 matrices. Choose one row from each matrix. These are the ordered pairs that will be placed...

1 giorno fa

Risolto


Find best placement for ordered dominoes (harder)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

1 giorno fa

Risolto


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

1 giorno fa

Risolto


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

1 giorno fa

Risolto


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

1 giorno fa

Risolto


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

1 giorno fa

Risolto


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Input...

1 giorno fa

Risolto


Find perfect placement of non-rotating dominoes (easier)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

1 giorno fa

Risolto


Scoring for oriented dominoes
Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

1 giorno fa

Risolto


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

1 giorno fa

Risolto


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

1 giorno fa

Risolto


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

1 giorno fa

Risolto


Create a vector
Create a vector from 0 to n by intervals of 2.

1 giorno fa

Risolto


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not to use d...

1 giorno fa

Risolto


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

1 giorno fa

Risolto


Find max
Find the maximum value of a given vector or matrix.

1 giorno fa

Risolto


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

1 giorno fa

Risolto


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

1 giorno fa

Risolto


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

1 giorno fa

Risolto


Nth roots of unity
First, find the n nth roots of unity. eg if n = 6, find the n distinct (complex) numbers such that n^6 = 1. <https://en.wiki...

1 giorno fa

Risolto


Matrix
The fourth problem in Linear Algebra group. Create a matrix like this: 14 7 26 7 8 6 3 0 30

1 giorno fa

Risolto


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

1 giorno fa

Risolto


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

1 giorno fa

Risolto


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

2 giorni fa

Risolto


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

2 giorni fa

Risolto


Return the first and last characters of a character array
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

2 giorni fa

Risolto


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

2 giorni fa

Risolto


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to find the logical indices o...

2 giorni fa

Risolto


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

2 giorni fa

Carica altro