Solved


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

24 days ago

Solved


How to subtract?
*&plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn* * Imagine you need to subtract one...

24 days ago

Solved


Summing Digits within Text
Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

24 days ago

Solved


Create a Matrix of Zeros
Given an input x, create a square matrix y of zeros with x rows and x columns.

24 days ago

Solved


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

24 days ago

Solved


Magic!
Check whether the input matrix is a normal magic square: http://en.wikipedia.org/wiki/Magic_square Output the logical value tr...

24 days ago

Solved


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

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

24 days ago

Solved


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

24 days ago

Solved


Matlab Basics - Pick out parts of a vector
Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...

24 days ago

Solved


Cumulative product of a vector
Cumulative product of a vector example x=[1 2 5 10], then answer must be [ 1 2 10 100] *If you like this prob...

24 days ago

Solved


How to calculate log?
There is a log that have base 5. How to calculate? log5(x)?

24 days ago

Solved


Change string to number
Change given string to number. (hint: there is already function) Changing from ['1234'] to [1234] is one of example

24 days ago

Solved


Write a code that will follow the equation y = x * (x + x) * x.
If x = 5, y = 5 * (5+5) * 5 = 250

24 days ago

Solved


Square root of a number
Write a code that will output the square root of x.

24 days ago

Solved


Find the area of a triangle
Given a triangle with a base b and height h, return the triangle area.

24 days ago

Solved


Getting values from a vector
This exercise is for finding the values that meet your criteria. a = [-5 28 7 83 73]; b = 23 ; c = (a > b) Then : c = ...

24 days ago

Solved


Flipping a Matrix
Flipping matrix up and down. If a central row is exists, leave it, and flip remaining rows. Example Mat = magic(3) ...

24 days ago

Solved


Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example start with x = 1 and y = 3 end with y = 1 and x = 3 Do NOT simply r...

24 days ago

Solved


Remove a specific character with another
Remove any (-) dash sign with (_) underscore Ex = 'The-Journey-of-thoudsands-miles-starts-with-a-single-step' y = 'The_Jour...

24 days ago

Solved


Half-Swap
Given a vector with an even number of elements, rearrange it so that the elements in its first half are switched with those i...

24 days ago

Solved


Swap between columns
The idea is to swap between second and second last column Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; ...

24 days ago

Solved


Swap between first and last
The idea is to swap between first and last row Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; ...

24 days ago

Solved


Swap between first and last column
The idea is to swap between first and last column Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 ...

24 days ago

Solved


Swap between rows
The idea is to swap between second and second last row Ex = [1 2 3 4 5; 5 4 3 2 1; 1 2 3 4 5; 1 2 3 4 5; ...

24 days ago

Solved


Generalised Hamming Number
Inspired by Project Euler n°204 and Problem 1308 by James A generalised Hamming number of type n, has no prime factor larger ...

24 days ago

Solved


Find all vampire fangs
A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a number v that is the product of two numbers x and y such th...

24 days ago

Solved


Fangs of a vampire number
A vampire number is a number v that is the product of two numbers x and y such that the following conditions are satisfied: at ...

24 days ago

Solved


Find vampire numbers
A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a number v that is the product of two numbers x and y such th...

24 days ago

Solved


Proper Factors
Generate the proper factors of input integer x and return them in ascending order. For more information on proper factors, refer...

24 days ago

Load more