Scaling an imaged array

9 Ansichten (letzte 30 Tage)
Frank
Frank am 8 Aug. 2011
A = Some matrix of dimension (n x n)
'image(A)' creates an image with side length of n. Is there there a way to resize this image?
  3 Kommentare
Frank
Frank am 9 Aug. 2011
Change the size of the axis. So display a shrunken version of the image.
Frank
Frank am 9 Aug. 2011
Actually, the value of the axis. If image(A) is plotted from x=[0 10] and y = [0 10], a rescaled version would be the same image but, say, a quarter of the size plotted from x = [0 5] and y = [0 5].

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 8 Aug. 2011
You can pass in to image() the x and y coordinates of the lower left and upper right centers of the corresponding pixels (note this is not the coordinates of the edges of the pixels.) The coordinates would be in whatever data coordinates are in effect (or get rescaled to in later calls).
Note that changing the coordinates might not have an visual result unless there is already spare room in the axes. The size of the axes (relative to the uipanel or figure) determines the density of the data coordinates.
If your image is relatively small and there is obviously more available room, then something might have executed "axis tight" and you might want to reverse that.

Community Treasure Hunt

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

Start Hunting!

Translated by