Image Simulation Using the Randon Number
clc
clear
M=10;
N=10;
tt=10;
for t=1:tt;
for i=1:M;
for j=1:N;
A(i,j,t)=0;
B(i,j,t)=0;
end
end
end
for t=1:tt;
j=5;
ttt(t)=randn(1,1);
for i=M/2:M+ttt(t);
B(i,j,t)=2000;
end
end
for t=1:tt;
C(:,:,t)=A(:,:,t)+B(:,:,t);
end image(C(:,:,t))
for t=1:tt;
image(C(:,:,t))
xlabel('x')
ylabel('y')
title('Movie')
MM(t)=getframe end frame_order = [1:tt 1:1:tt];
number_repeats = 4;
movie(MM, [number_repeats frame_order]);
map = hsv(16);
colorbar
clear
M=10;
N=10;
tt=10;
for t=1:tt;
for i=1:M;
for j=1:N;
A(i,j,t)=0;
B(i,j,t)=0;
end
end
end
for t=1:tt;
j=5;
ttt(t)=randn(1,1);
for i=M/2:M+ttt(t);
B(i,j,t)=2000;
end
end
for t=1:tt;
C(:,:,t)=A(:,:,t)+B(:,:,t);
end image(C(:,:,t))
for t=1:tt;
image(C(:,:,t))
xlabel('x')
ylabel('y')
title('Movie')
MM(t)=getframe end frame_order = [1:tt 1:1:tt];
number_repeats = 4;
movie(MM, [number_repeats frame_order]);
map = hsv(16);
colorbar
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2013 - http://cfd2012.com