Help With Matlab
#11
Guest
Posts: n/a
Ok, i got some help with thte lab and i figured out how to create the images... just thought i'd share with you guys that helped me.
Top left image:
>> a(100,100)=0;
>> a(25:75,25:75)=1;
>> imshow(a)
Top Middle Image:
>> a(200,200)=0;
>> a(100:200,1:100)=1;
>> a(1:100,100:200)=1;
>> imshow(a)
Top Right Image:
>> a=zeros(200,200);
>> x=0;
>> for i=1:200;
a(i,: )=x;
x=x+.005;
end
>> imshow(a)
Bottom Left Image: (with respect to the above matrix)
>> b=a';
>> imshow(b)
Bottom Middle:
>> for i = 1:200;
for j =1:200;
d=sqrt((i-100)^2+(j-100)^2);
a(i,j)=d;
end
end
>> imshow(a,[0 max(max(a))])
Bottom Right:
>> a=rand(200);
>> imshow(a)
Pretty easy now tha ti know what was going on!
Top left image:
>> a(100,100)=0;
>> a(25:75,25:75)=1;
>> imshow(a)
Top Middle Image:
>> a(200,200)=0;
>> a(100:200,1:100)=1;
>> a(1:100,100:200)=1;
>> imshow(a)
Top Right Image:
>> a=zeros(200,200);
>> x=0;
>> for i=1:200;
a(i,: )=x;
x=x+.005;
end
>> imshow(a)
Bottom Left Image: (with respect to the above matrix)
>> b=a';
>> imshow(b)
Bottom Middle:
>> for i = 1:200;
for j =1:200;
d=sqrt((i-100)^2+(j-100)^2);
a(i,j)=d;
end
end
>> imshow(a,[0 max(max(a))])
Bottom Right:
>> a=rand(200);
>> imshow(a)
Pretty easy now tha ti know what was going on!
Thread
Thread Starter
Forum
Replies
Last Post