PDA

View Full Version : Labelling graphs/images with text() function


nyxynyx
Mar3-09, 07:55 AM
Hi, I'm plotting some circles in a 20x20 arrangement using the rectangle tool and I have to label each of the circle a number from 1 to 400. However, the following code does not do what i once, since i think i can only label with strings and not running numbers...


for i=1:400
text(x_pos(i),y_pos(i),i)
end


What else can i try? Thanks!

f95toli
Mar3-09, 08:09 AM
You could just convert the number to a string using the num2str function.
Look it up in the help.

nyxynyx
Mar3-09, 09:26 PM
thnx f95toli this works!