Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

translating an image 1

Status
Not open for further replies.

elanb

Bioengineer
Dec 19, 2004
2
after using imread to get a gif file, how do I tell matlab where on the screen to display it (rather than the default center). I am actually trying to show two different gif files side by side at the same time.
Sorry if this is trivial but I/m a relative novice and can't find a simple function to do it!
 
Replies continue below

Recommended for you

Hi,

1)get the screen size:
>> D=get(0,'screensize');
2) get the half screen dimensions:
x=D(3)/2;
y=D(4)/2;
3)create a figure in the lower left corner:
4)figure('position',[1 1 x-1 y-1])
load the image into a matrix and display it :
M1=imread('imagename.ext');
imagesc(M1)
5)repeat for the second image (at the upper right corner):
h2=figure('position',[x+1 y+1 x-1 y-1]);
M2=imread('imagenam2.ext');
imagesc(M2)
You can change image position by changing the figure position. For example:
set(h1,'position',[1 y-1 x-1 y-1])
to bring the first image to the upper left corner.


Joe Sababa

BSTeX - Equation viewer for Matlab


Joe
BSTeX- Equation viewer for Matlab
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor