Problem 535. Rotate and display numbered tile
Imagine a square tile with four numbers on it, one on each edge. We will call these edges north, east, south, and west.
If the four numbers were [1 5 7 9], this vector would be displayed with the numbers going around clockwise from the north like so:
1 9 5 7
But the tile can appear in four different orientations. Let's say that when the north is 1, then the first number appears in the north position. If north is 2, then the second number appears in the north position, and so on. So if the tile numbers are [1 5 7 9] and the orientation parameter north is 3, then it would display like so, since 7 is the third number:
7 5 9 1
The numbers you are given will always be one or two digit positive integers. You must return a 3-by-6 character array that fits this template:
..NN.. WW..EE ..SS..
where dots are used to indicate spaces (ASCII 32). One digit numbers should be right aligned. In the example given immediately above, the output should look like this:
Inputs t = [1 5 7 9], north = 3 Output is [' 7 ' ' 5 9' ' 1 ']
Solution Stats
Problem Comments
-
2 Comments
I solved the problem using repmat but it gives a message that
"There was an issue submitting your solution
Remove inappropriate content. For guidelines, see About Cody"
Can anybody help me out ......
awesome problem!
Solution Comments
Show commentsGroup

ASEE Challenge
- 10 Problems
- 250 Finishers
- Find the biggest empty box
- How long is the longest prime diagonal?
- Flag largest magnitude swings as they occur
- Solitaire Cipher
- Spot the outlier
- How long is the longest prime diagonal?
- Solitaire Cipher
- Implement simple rotation cypher
- Given a window, how many subsets of a vector sum positive
- How many trades represent all the profit?
- Flag largest magnitude swings as they occur
- Make a run-length companion vector
- Spot the outlier
- Find a subset that divides the vector into equal halves
- How long is the longest prime diagonal?
- Find the biggest empty box
Problem Recent Solvers357
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!