




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A lecture note from a fall 2008 computer science engineering (cse) course, cse185, focusing on matlab and the image processing toolbox. An overview of matlab, including data types, converting between data types, and vectors. It also discusses indexing and selecting blocks of elements in vectors and matrices, as well as logical indexing and using the find function.
Typology: Lab Reports
1 / 8
This page cannot be seen from the preview
Don't miss anything!
© 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins www.imageprocessingbook.com
Digital Image Processing Using MATLABDigital Image Processing Using MATLAB®®
v = [1 3 5 7 9] v = 1 3 5 7 9
v(2) ans = 3
w = v'
w =
1 3 5 7 9
v(1:3) ans =
1 3 5
v(3:end) ans =
5 7 9
v(1:2:5) ans =
1 5 9
v(5:-2:1) ans =
9 5 1
v(:)
ans =
1 3 5 7 9
v([1 4 5])
ans =
1 7 9
ans =
3 6 9
E = (B==0) E = 0 0 1 0 0 1 0 0 1 whos E Name Size Bytes Class E 3x3 72 double array (logical) Grand total is 9 elements using 72 bytes
[i,j] = find(B~=0); i' ans =
1 2 3 1 2 3
j' ans =
1 1 1 2 2 2
d = ndims(A)
d =
2
size(T2) ans =
2 3
size(T2,1) ans =
2
size(T2,2) ans =
3
sum(T2) ans = 5 7 9 sum(T2,1) ans =
5 7 9
sum(T2,2) ans = 6 15
sum(sum(T2))
ans =
21
A = 5*ones(3,3) A =
5 5 5 5 5 5 5 5 5
B = rand(2,4)
B =
0.9501 0.6068 0.8913 0. 0.2311 0.4860 0.7621 0.
© 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins www.imageprocessingbook.com
Digital Image Processing Using MATLAB Digital Image Processing Using MATLAB®®
© 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins www.imageprocessingbook.com
Digital Image Processing Using MATLABDigital Image Processing Using MATLAB®®
© 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins www.imageprocessingbook.com
Digital Image Processing Using MATLAB Digital Image Processing Using MATLAB®®
© 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins www.imageprocessingbook.com
Digital Image Processing Using MATLABDigital Image Processing Using MATLAB®®
f = zeros(M,1); % preallocate the array
for x=1:M f(x) = A * sin((x-1)/(2*pi)); end
for x=1:M f(x) = A * sin((x-1)/(2*pi)); end
or
for x=1:M f(x) = A * sin((x-1)/(2*pi)); end
x = 0:M-1; f = A * sin(x/(2*pi));
or
disp(A); 1 2 3 4
sc = 'Digital Image Processing'; disp(sc); Digital Image Processing
x = 5;
fprintf(1,'x = %.5f',x); x = 5.
fprintf(1,'x = %e',x); x = 5.000000e+
t = input('Enter you data: ','s'); Enter you data: 1,2, disp(t) 1,2, class(t) ans = char size(t) ans = 1 5 n=str2num(t) n = 1 2 4 class(n) ans = double size(n) ans = 1 3