User Input From a Grid

3 ビュー (過去 30 日間)
Jake
Jake 2013 年 5 月 22 日
I want to display an image with a grid, have the user select different colors in a GUI and click on the grid. Once they click, that box in the grid turns into the color they chose.
I found an answer on Matlab Central that said that I should use imagesc to display the image, which I have successfully done, albeit without a grid. Next, I want to define a variable A = zeros(N,N). N will be the number of rows and columns in my grid. Then, when the user clicks one box in the grid, the respective 0 in the matrix A will change to a different number (Zdata?).
So in the GUI if the user selects blue and clicks on the box in row 50, column 50, then A(50,50) will change to 2 (2 being the number that stands for blue). Then the user may click more boxes with blue or choose orange, and while still keeping the blue dots, be able to click on the grid with orange.
I'm pretty much a beginner learning how to use Matlab so anything advanced will be tough for me to follow. However, any help is appreciated. Thanks!

回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by