Link to home
Start Free TrialLog in
Avatar of ty-exexch-ko
ty-exexch-koFlag for Albania

asked on

Display images side by side

How I can in Matlab using figure and imshow commands to display images side by side ?
Avatar of aaver
aaver
Flag of Afghanistan image

Have you tried using subplot?
I would do something like:

figure,
subplot(121), imshow(img1,[]);
subplot(122), imshow(img2,[]);
Avatar of ty-exexch-ko

ASKER

Hi Kendor

small question
the number 121 inside subplot function refer for what ?

I try using numbers 1, 2 , 3 and etc. I get an error message
If I want to use subplot with 3 or 4 images to display side by side ?

I get an error message

I think available diferent way to use with figure and imshow
ok subplot functions as follows:

the first number tells you how many rows you have, the second number says how many columns and the third defines the overall position.

say you have 2 rows and 3 columns you would write:
subplot(2,3,x) and x would be the position like:
1 2 3
4 5 6

otherwise refer to: http://www.mathworks.com/help/techdoc/ref/subplot.html
ASKER CERTIFIED SOLUTION
Avatar of Kendor
Kendor
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial