Would someone kindly please tell me why imagesc is not doing what I want it to:
I am trying to get a grid of chars out like:
http://wetans.net/word-search-worksheets-for-kids
Here is the code:
A = [5,16,18,4,9;
9,10,14,3,18;
2,7,9,11,21;
3,7,2,19,22;
4,9,10,13,8]
AAsChars = char(A + 96);
imagesc(AAsChars);
The short answer is - you are using the wrong function for your job.
imagesc
will take a map of values and convert it to intensities - one pixel per value. You want it to magically take a character value and turn it into the representation (many pixels) of the character that this represents (without regard to font, etc).You probably want to create an empty background, then put text characters at the locations you want. Something like (not tested):
This should put the string (character) at the location (i,j). Experiment a bit - not sure I have the syntax of text() and the formatting of the string (with "%c") right and can't check right now.