Solved


Easy Sequences 10: Sum of Cumsums of Fibonacci Sequence
The function F(n) is defined as the set of Fibonacci numbers from the first up to the n-th. S(n) is the result of applying to F,...

3 years ago

Solved


Easy Sequences 9: Faithful Pairs
A "faithful number" is a non-prime number that is one less or one more than some prime number but not both. For example, for num...

3 years ago

Solved


Find distance travelled by an object starting from rest in time 't' and linear acceleration 'a' = 3t
Find distance travelled by an object starting from rest in time 't' with linear acceleration a = 3t. You are given time t as an ...

3 years ago

Solved


Easy Sequences 25: Product of Series
The function 'P(n)' is defined as the series product: where 'T(n)' is the triangular sum: ...

3 years ago

Solved


A sequence of Ones
You are given number(s) with all digits - 1. Your answer will depend on the count of 1 in the given number, for example - x1...

3 years ago

Solved


Create a column vector of n elements between a and b (both included)
Given lower limit a and an upper limit b, create a column vector of n elements inclusive of a and b. For example: a = 1, b = 4,...

3 years ago

Solved


Gaussian elimination
Get the Gussian elimination of the Matrix Given You cannot use built-in Matlab functions triu :)

3 years ago

Solved


Find the outcast
All pairs have the same difference except for one. Output the index of the latter Example: input =[0 1; 1 0; ...

3 years ago

Solved


Count the peaceful queens
In a 5x5 chessboard with a queen of one color (white, say) on the perimeter, one can place 12 black queens on the board such tha...

3 years ago

Solved


Length of shortest path in a directed graph.
Given a directed graph and a start and end node in the graph, return the minimum number of hops required to reach the end node f...

3 years ago

Solved


Determine roll pitch yaw angles from a 3D rotation matrix
Consider an aerospace application where the world reference coordinate frame {W} and a body-fixed coordinate frame {B}. The ori...

3 years ago

Solved


determine skid distance of car
Determine the distance a car skids to a stop given initial velocity (v) and time (t).

3 years ago

Solved


Convert vector datasets to plot with imagesc instead of scatter
For large datasets this allows much faster plotting. An irregular 2D spatial sampling is provided in x and y vectors with a d...

3 years ago

Solved


Chain multiplication - 03
Following up the problem in 55305, you found the minimum number of multiplications needed to multiply a chain of matrices. In ...

3 years ago

Solved


Sum of 2 numbers in array
Given an array and a target sum, return true if any 2 numbers in the array sum up to the given target sum. Both numbers cannot h...

3 years ago

Solved


Draw 'S'
draw S using nxn matrix, where n is odd and greater than 4 S = [1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 ...

3 years ago

Solved


Define an arithmetic sequence
Given three numbers n, a, and d, define an arithmetic sequence of n terms with a being the initial term of the sequence and d be...

3 years ago

Solved


Return longest string in 1-D array of strings
Find the longest string in an array of strings. Return an empty string if the initial array is empty. If there are multiple stri...

3 years ago

Solved


Higher! Lower! Correct!

3 years ago

Solved


Merge structs on fields
Merge a bunch of structs into one, containing the field names and corresponding values of all input structs. For duplicate field...

3 years ago

Solved


Undocumented MATLAB tricks No. 1 - Save a function-returned struct
Often we face the case when we want to save a function-returned struct to a mat file with each of its field as individual variab...

3 years ago

Solved


Exhaust all possible logical vectors
Input a length argument and list all possible logical vectors of that length. My solution is of size 29. Can you find an even s...

3 years ago

Solved


Count of Unique Elements of a Vector
Count the number of times each unique element appears in a vector. Example: Input x = [2 9 1 2 4 9 2] Output y = [1 1; 2 3; 4...

3 years ago

Solved


Find two numbers that add up to the target value
Given a vector A and target n, return the indices of two numbers that add up to n. If there are multiple solutions, return the f...

3 years ago

Solved


Mix it up!
Given an input string S, return a new string B, that is created by taking one character from the front and then the end iterativ...

3 years ago

Solved


Sort vector by number of prime factors of each element
Sort a given array based on how many prime factors each term has. Sort from least to greatest and output original values. Ex: ...

3 years ago

Solved


String Manipulator
Write a script that takes a string as an input and returns a cell array containing – I. the count of vowels. II. Find the ind...

3 years ago

Load more