Matrix to column conversion
Given a matrix of any size, convert it into a column vector.
e.g A=[10 20 30;
40 50 60]
then,
B = [10;
40;
...
5 years ago
Solved
Sorting
Assume that x is an n-by-2 matrix. The aim is to return the first column of x, but sorted according to the second column.
Exa...
5 years ago
Solved
Distance walked 3D
suppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance...
5 years ago
Solved
matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below.
...
5 years ago
Solved
Which coins to give
I was in shop today. I admired, how shop assistant had to think, which coins to give me.
The task is we have a vector v=[0.5 0....
5 years ago
Solved
center of mass
R is a given matrix with size [n,2]. R(i,:) is interpreted as the 2D-position of a mass point with mass i. Calculate the center ...
5 years ago
Solved
How Far Can You Throw Something?
As you probably learned in your high school physics class, throwing an object at a 45 degree angle will give you the maximum ran...
5 years ago
Solved
Mirror Image matrix across anti-diagonal
Given an input number x, create a mirror image matrix 'Y' across the anti-diagonal. For example, if x=3,
Y = [1 2 3;
...
5 years ago
Solved
Valid Chess Moves
Using <http://en.wikipedia.org/wiki/Algebraic_chess_notation standard Algebraic notation> ('' for a pawn), given previous move a...
5 years ago
Solved
Dots in a Sphere
Return how many integer grid points there are inside a 3D sphere of radius _r_ centred at (0,0,0) (including points on the edge)...