how to add a boarder around a matrix

3 views (last 30 days)
Sarah Huynh
Sarah Huynh on 30 Jul 2015
Commented: Image Analyst on 30 Jul 2015
I'm most likely asking this question wrong but i'm making a simple game
https://www.mathworks.com/matlabcentral/answers/231792-how-do-i-change-one-value-in-a-matrix
and this was my last question but i realized i've made a mistake!
1 2 3 4 5 6 7 8
2 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0
6 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0
8 0 0 0 0 0 0 0
this is how the board will look like but i want the board to look like this
- 1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . . . . . .
4 . . . . . . . .
5 . . . . . . . .
6 . . . . . . . .
7 . . . . . . . .
8 . . . . . . . .
The dots would be preferred but i've also accepted that the zeros are just fine haha it doesn't effect the game statement really
but how can one create this boarder and also prevent the user from changing the value so if they input 1 1 it would not change the first number of the first row
also How would i indicate that the whole board is full of numbers now?
  1 Comment
Image Analyst
Image Analyst on 30 Jul 2015
Where do you want that? If you want to print it to the command window, use fprintf(). If you want it on a GUI, then use GUIDE and make a static text label, or a uigrid, and put that stuff in there.

Sign in to comment.

Answers (0)

Categories

Find more on Number games in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!