I want to plot a N*N pane figure, N is an integer.Who know how can I do that? Thanks in advance; any comments will be appreciate.
No products are associated with this question.
pane = zeros(10,10); temp_idx_to_fill = randperm(numel(pane)); idx_to_fill = temp_idx_to_fill(1:N); [row_to_fill, col_to_fill] = idx2sub(size(pane), idx_to_fill);
Now fill the locations at [row_to_fill(1), col_to_fill(1)], [row_to_fill(2), col_to_fill(2)] and so on.
In your programme I didn't understand the function of idx2sub and matlab can not recognise it.
6 Comments
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/43905#comment_90230
Frankly speaking, I want to write a program that can realize the "Memory Matrix". This is part of that. So I hope your help.
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/43905#comment_90232
What is "Memory Matrix" in this context?
Would it work for your purposes to turn on grid lines with the ticks set 1 unit apart?
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/43905#comment_90699
I have already plot the pane. The programme is below.
The Memory Matrix is a way to improve one's memory.
I can't describe it detailed. The website below is about that, you can easy understand what is it. ( http://www.lumosity.com/brain-games/memory-games/memory-matrix?utm_source=SilverpopMailing&utm_medium=email&utm_campaign=WelcomeF_S5_Poster1_2012.05.21&utm_content=&ll_src=WelcomeF_S5_Poster1_2012.05.21&ll_ch=EMAIL&ll_u=21856609&spMailingID=5346211&spUserID=MzAwODI5NzQ0ODIS1&spJobID=201868856&spReportId=MjAxODY4ODU2S0)
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/43905#comment_90701
Okay, so what is remaining for your question?
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/43905#comment_91036
Sorry for the long time no come. Because my family has some circs. I just realize plot the pane. And I don't konw how to come true that game. I konw it should be progammed in GUI. But i should know the basic programme first. The following step that I want to konw is how to fill the N pane among the 10*10 pane to black? N is random. Thank you for your help first.
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/43905#comment_91040
Hmmmm.... Looks like Google Translate didn't do such a good job on that one. Maybe if you reviewed some of Doug Hull's video tutorials ( http://blogs.mathworks.com/videos/) on GUI development you might learn how to do whatever it is that you want to do.