Ältere Kommentare anzeigen
clear
clc
d1=120; d2=94;
I =imread('C:\Users\SAMA CENTER\Desktop\girl.jpg');
J = imresize(I,[200 250]);
X = rgb2gray(I);
Y=X';
for k1=1:d1
for k2=1:d2
B(2*k1,k2)=X(k1, k2);
B(2*k1-1,k2)=floor((X(k1,k2)+X(2*k1-1,k2))/2);
end
end
imshow(B);
What's wrong with this code?? there is some wrong with the floor function what is it ???
2 Kommentare
Chandra Kurniawan
am 10 Mär. 2012
Please show me the error message!
noor
am 10 Mär. 2012
Akzeptierte Antwort
Weitere Antworten (1)
777
am 10 Mär. 2012
0 Stimmen
your code has x(2*k1-1) ,so when the value of k1=120 you reach a value which is out of bounds for x.
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!