ty-exexch-ko

asked on

# Display images side by side

How I can in Matlab using

**figure**and**imshow**commands to display images**side by side**?
Have you tried using subplot?

I would do something like:

figure,

subplot(121), imshow(img1,[]);

subplot(122), imshow(img2,[]);

figure,

subplot(121), imshow(img1,[]);

subplot(122), imshow(img2,[]);

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

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

ASKER

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

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

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

membership

Create an account to see this answer

Signing up is free. No credit card required.