Creating a number board from a matrix

조회 수: 1 (최근 30일)
DebiPrasad
DebiPrasad 2019년 1월 2일
편집: Matt J 2019년 1월 2일
Hi All
Please could you help me with this. I have a random 5x5 matrix as such:
A=reshape(randperm(25),[5,5])
I plan to have a board or a GUI output of the same array as a figure. In the figure generated, each grid correspondes to the value in the matrix.
Thanks.
D
  댓글 수: 2
Bob Thompson
Bob Thompson 2019년 1월 2일
What specific problem(s) are you running into? What do you have so far?
DebiPrasad
DebiPrasad 2019년 1월 2일
Well I have the matrix Ac that keeps changing after certain iterations. When I say changing, it means the non zero values are changed to 0. I can track that in the workspace using the disp command ofcourse, and it works all fine.
However, just for the aesthetics pov, i need the display matrix on a separate figure window along with the workspace variable.
Cheers
D

댓글을 달려면 로그인하십시오.

답변 (2개)

Matt J
Matt J 2019년 1월 2일
You could just do
openvar A
  댓글 수: 2
DebiPrasad
DebiPrasad 2019년 1월 2일
Thanks, but this is not what I want here.
Matt J
Matt J 2019년 1월 2일
Why not? What does it lack?

댓글을 달려면 로그인하십시오.


Matt J
Matt J 2019년 1월 2일
편집: Matt J 2019년 1월 2일
You could also use uitable, e.g.,
f = figure;
t = uitable(f,'Data',A,'Position',[20 20 262 204]);

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by