Problem 60227. Rotate matrix 60 degrees
Given a 2*m-1 by 4*m-3 matrix in which certain elements form a hexagon of side length m, rotate the hexagon 60 degrees counterclockwise, as shown below for m=3:
A=[
'--A-A-A--'
'-B-B-B-B-'
'C-C-C-C-C'
'-D-D-D-D-'
'--E-E-E--']
rot60(A)=[
'--A-B-C--'
'-A-B-C-D-'
'A-B-C-D-E'
'-B-C-D-E-'
'--C-D-E--']
A=rot60(A,n) should rotate the hexagon 60*n degrees counterclockwise (and thus clockwise if n<0).
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers3
Suggested Problems
-
5897 Solvers
-
Find state names that start with the letter N
1197 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3103 Solvers
-
Back to basics 19 - character types
261 Solvers
-
Create a random vector of integers with given sum
52 Solvers
More from this Author11
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!