How to illustrate a cell array
古いコメントを表示
I have the following cel array:
x{1}=[0 0 0 0];
x{2}=[0 0 -1 0 0];
x{3}=[0 0 0 1 1 0];
x{4}=[0 0 1 1 0];
x{5}=[-1 -1 0 -1];
Which supposed to represent the state of Abalone game board, like this:

Where zeros mean empty cell, -1's mean occupied by green marble, and 1's occupied by blues.
Is there any possible way to illustrate the board using my cell array?
5 件のコメント
Jan
2019 年 7 月 16 日
What does "illustrate" mean here? What is the wanted output?
Naza Karim
2019 年 7 月 16 日
Joel Handy
2019 年 7 月 16 日
So is your question, "How do I take the cell array, and draw the figure I've sketched?"
The isnt going to be a simple one line function call like fig = drawAbalone(x); You'd need to process x and draw the board using things like the viscircles function
Naza Karim
2019 年 7 月 16 日
Joel Handy
2019 年 7 月 16 日
編集済み: Joel Handy
2019 年 7 月 16 日
It can definitely be done. viscircles should let you create a figure with all of the circles. The fill function will let you plot the hexagon. Placing all of the shapes should be inde[endant of X. all you need to do while plotting the board is refer to your cell array to choose colors.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Title についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
