IMREAD FUNCTION
Reads a greyscale or color image from the file specified by the string filename , where the string fmt specifies the format of the file. If the file is not in the current directory or in a directory in the MATLAB path, specify the full pathname of the location on your system.
Syntax
A = imread(filename,fmt)
[X,map] = imread(filename,fmt)
[…] = imread(filename)
[…] = imread(URL,…)
[…] = imread(…,idx) (CUR, GIF, ICO, and TIFF only)
[…] = imread(…,’PixelRegion’,{ROWS, COLS}) (TIFF only)
[…] = imread(…,’frames’,idx) (GIF only)
[…] = imread(…,ref) (HDF only)
[…] = imread(…,’BackgroundColor’,BG) (PNG only)
[A,map,alpha] = imread(…) (ICO, CUR, and PNG only)
In Matlab :
[p1, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo1.jpg') [p2, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo2.jpg') [p3, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo3.jpg') [p4, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo4.jpg') [p5, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo5.jpg') [p6, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo6.jpg') [p7, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo7.jpg') [p8, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo8.jpg') [p9, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo9.jpg') [p10, map] = imread('E:\kuliah\TUGAS 1 - MATRIKS\photo10.jpg') |
IMADD FUNCTION
Add two images or add constant to image
Syntax
Z = imadd(X,Y)
In Matlab :
sub1 = imadd(p1,10) sub2 = imadd(p2,20) sub3 = imadd(p3,30) sub4 = imadd(p4,40) sub5 = imadd(p2,50) sub6 = imadd(p6,60) sub7 = imadd(p7,70) sub8 = imadd(p8,80) sub9 = imadd(p9,90) sub10 = imadd(p10,100) |
SUBPLOT FUNCTION
Divides the current figure into an m -by- n grid and creates an axes for a subplot in the position specified by p . MATLAB® numbers its subplots by row, such that the first subplot is the first column of the first row, the second subplot is the second column of the first row, and so on.
Syntax
subplot(m,n,p)
subplot(mnp)
subplot(m,n,p,’replace’)
subplot(m,n,p,’align’)
subplot(h)
subplot(‘Position’,[left bottom width height])
h = subplot(…)
IMSHOW FUNCTION
Show Image
Syntax
imshow(I)
imshow(X,map)
imshow(filename)
imshow(I,[low high])
imshow(___,Name,Value)
himage = imshow(___)
imshow(I,RI)
imshow(X,RX,map)
imshow(gpuarrayIM,___)
In Matlab :
subplot(2,5,1) imshow(sub1) subplot(2,5,2) imshow(sub2) subplot(2,5,3) imshow(sub3) subplot(2,5,4) imshow(sub4) subplot(2,5,5) imshow(sub5) subplot(2,5,6) imshow(sub6) subplot(2,5,7) imshow(sub7) subplot(2,5,8) imshow(sub8) subplot(2,5,9) imshow(sub9) subplot(2,5,10) imshow(sub10) |
Running :