3
ans
whos ans
i=3
i=3;

x=[2 4 5 32 ]
x(1)
x(5)
x(4)
x=[1 2 3; 4 5 6; 7 8 9]
x'
x=[2 4 5 32 ]
mean(x)
std(x)
length(x)
x=[1 2 3; 4 5 6; 7 8 9]
length(x)
x=[1 2 3 12; 4 5 6 11; 7 8 9 10]
length(x)
size(x)
[h,w]=size(x)
h
[h,w]=size(x);
edit
rand(5)
x=rand(5);
x
x=randi(5);
x
help randi
x=randi(5);
mean(x)
x=rand(5);
x
mean(x)
mean(mean(x))
sum(sum(x))
std(std(x))
x=rand(50);
x(10:12,10:12)
x(10:2:12,10:2:12)
x(10:3:12,10:3:12)
x(10:4:12,10:4:12)
x=rand(50,2);
x=rand(50,50,3);
x=rand(50,50,3,3);
x=rand(50,50,3);
figure, imshow(x)
x=linspace(0,2*pi)
y=sin(x)
plot(x,y)
y=cos(x)
plot(x,y)
pi
format long
pi
x=rand(3,3);
x
x*x
x.*x
x./x
inv(x)
det(x)
x>0.5
x(ans)
x>0.5
x(ans)
x(~ans)
x(~(x>0.5))
I=imread('Koala.jpg')
size(I)
imshow(I)
imshow(I(:,:,1))
imshow(I(:,:,2))
imshow(I(:,:,3))
J=I
J(:,:,2)=0;
J(:,:,3)=0;
imshow(J)
I=imread('naturalscene1.jpg');
size(I)
imshow(I)
imwrite('nature.jpg',I)
imwrite(I,'nature.jpg')
size(I)
imshow(I(20:100,20:100,:))
imshow(I(20:100,:,:))
R=I(:,:,1);
G=I(:,:,2);
B=I(:,:,3);
B=I(:,:,4);
imshow(R)
J=[R];
J=[R:G];
J=[R;G];
size(J)
J=[R G];
size(J)
imshow(J)
J=[R;G];
imshow(J)
figure, imshow(J)
J=[R;G;B];
figure, imshow(J)
X=concat(R,B);
K(:,:,1)=R;
K(:,:,2)=G;
K(:,:,3)=B;
figure, imshow(K)
K(:,:,2)=B;
figure, imshow(K)
help circshift
L=circshift(K,[30,20]);
figure, imshow(L)
L=circshift(K,[-30,20]);
figure, imshow(L)
(K-I)
SSD=sum((K-I).^2)
SSD=sum(sum(sum((K-I).^2)))
SSD=sqrt(sum(sum(sum((K-I).^2))))
Id=im2double(I)
SSD=sum(sum(sum((im2double(K)-im2double(I)).^2)))
SSD=sqrt(sum(sum(sum((im2double(K)-im2double(K)).^2))))
