Using MATLAB create a 1000x1000 array that includes a couple of circles of different pixel values, and plot the resulting image. You should do this by creating a function to which you pass the radius, center coordinates and color or grey scale value, which then alters the image array.
c=rand(1000,1000) by using this syntax you can create 1000*1000 array
program:
clf
axis equal
hold on
c=rand(1000,1000); %create 1000*1000 array
[row col]=size(c) %it gives number of rows and columns
d=c; % create new array d by copying c into it
i=0; %i used to count number of circles
for t=1:row %to alter the array value iterate through loop
for z=1:col
X = rand(5,1);
Y = rand(5,1);
centers = [X Y];
radii = 0.1*rand(5,1);
d(t,z)=viscircles(centers,radii,'Color','red'); % Display the
circles.
c(t,z);
i=i+1;
d(t,z);
end
end
i %print value of i
Get Answers For Free
Most questions answered within 1 hours.