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.
6 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...
Check if number exists in vector
Return 1 if number a exists in vector b otherwise return 0.
a = 3;
b = [1,2,4];
Returns 0.
a = 3;
b = [1,2,3];
Returns 1.
6 months ago
Solved
Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B.
So if
A = [1 2 3;
4 5 6];
...
6 months ago
Solved
Reverse the vector
Reverse the vector elements.
Example:
Input x = [1,2,3,4,5,6,7,8,9]
Output y = [9,8,7,6,5,4,3,2,1]
6 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...
6 months ago
Solved
Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false.
Example...