Given a matrix, print all its elements in the spiral form (clockwise direction).
a=[16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1]
output = [16 2 3 13 8 12 1 15 14 4 9 5 11 10 6 7]
I think some of the solution vectors in this problem are incorrect. In problem 2, for example, all the numbers after 120 are duplicates.
sorry about that..there was a bug in my code
It's been fixed now
Project Euler: Problem 10, Sum of Primes
chance in percent for minimum K heads when a good coin is tossed N times?
Back to basics 25 - Valid variable names
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
Cell Source Index
Don't be Too Greedy!!
How many ways?
Tell your secret
Repeat elements of a vector
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office