Anda di halaman 1dari 4

# 3/1/2019 vaishexpt72

## %YESHANTRAO CHAVAN COLLEGE OF ENGINEERING

%DEPARTMENT OF ELECTRONICS AND TELECOMMUNICATION
%NAME OF COURSE:SIMULATION LAB
%ROLL NO:41
%SEMESTER:4TH A
%SESSION:2018-2019
%DATE OF EXPERIMENT:26-2-2019
%EXPERIMENT NO:7

%Exercise:
%1. Read ‘cameraman.tif’ image, write a program to generate following images.
%Use subplot to display these images with original. Give proper title to each subplot
B=fliplr(I);
C=flipud(I);
d=imrotate(B,180);
subplot(1,2,1),imshow(B)
title('Original')
subplot(1,2,2),imshow(C)
title('Rotated')

## %2.Write a command to generate following image

imshow(p)
k=imcrop(p,[1,1,210,256]);
imshow(k)
figure,imshow(p)

file:///I:/matlab%20prac/exp7/EXP7/html/vaishexpt72.html 1/4
3/1/2019 vaishexpt72

%3. Read ‘rice.png’ image into a variable I, write a program to perform following equation on
%the input image to get the output image G given by G=L-1-I, where L is the maximum
%value of element of input image.
%Use Subplot to show original image and output image. Comment on the result.
%q=max(I)
%L=max(q)
L=max(max(I))
G=L-1-I;
subplot(1,2,1),imshow(I)
title('org')
subplot(1,2,2),imshow(G)
title('new')

file:///I:/matlab%20prac/exp7/EXP7/html/vaishexpt72.html 2/4
3/1/2019 vaishexpt72

L =

204

## %4.Create ten dimensional row vector R of element in the range of 0 to 10 in command

%window. Save that vector in .mat file. After that, clear workspace. Then write a program
%to find mean and standard deviation of that vector R. Also plot vector R. Use load
%function to retrieve that vector in m-file.
R=0:1:10
save m.mat
clear all
M= mean(R)
S= std(R)
figure,plot(R)

R =

0 1 2 3 4 5 6 7 8 9 10

M =

S =

3.3166

file:///I:/matlab%20prac/exp7/EXP7/html/vaishexpt72.html 3/4
3/1/2019 vaishexpt72

%5.Write an array of odd numbers from 1-19. Save the array to an Excel document. Clear
%your workspace and import the array from the Excel readable file you just created
V=1:2:19
xlswrite('q5.xls',V)
clear all

V =

1 3 5 7 9 11 13 15 17 19

sheet =

1 3 5 7 9 11 13 15 17 19

%CONCLUSION:Problems related to data import and export were solved sucessfully using MATLAB

## Published with MATLAB® R2014a

file:///I:/matlab%20prac/exp7/EXP7/html/vaishexpt72.html 4/4