Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Question about imshow syntax

1 Ansicht (letzte 30 Tage)
Son
Son am 23 Jun. 2013
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hi all,
I have some problems with the 'imshow' syntax. For example if I have the below code :
a=zeros(1,3000)
for i=1:3000
if rand<0.5
a(1,i)=1;
end
end
imshow(a,'InitialMagnification', 'fit')
Because the matrix is two "long", 3000 columns, so when I use imshow to display, I just see it's a long line. How can I fix this problem, make it bigger ?.
The second question is, when I display it, the place where its value is 1, it's displayed with white dot and the black one for the value 0. If I want to change the dot to any other symbol, for example, triangle, symbol x,.... How can I do that ?
Thanks all in advance
  2 Kommentare
Jan
Jan am 24 Jun. 2013
What does "bigger" mean here, when the image has a width of 1 pixel?
Btw., a faster method to create the image:
a = double(rand(1, 3000) < 0.5);
Son
Son am 24 Jun. 2013
I mean if you use the smaller matrix, for example a = zeros(1,100) and then imshow(a), you can see more clearly the element in the matrix than using the bigger matrix, what do you mean a width of 1 pixel

Antworten (1)

Jan
Jan am 24 Jun. 2013
Bearbeitet: Jan am 24 Jun. 2013
To plot triangles instead of dots, use the plot command and obtain the corrinates by find.
  1 Kommentar
Son
Son am 24 Jun. 2013
"obtain the corrinates by find" I dont really get this one, could you tell more clearly

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by