MATLAB CODE:
function [x,y]=getCircle(center,radius);
theta=0:pi/100:2pi;
x=radiuscos(theta)+center(1);
y=radius*sin(theta)+center(2);
end
% pprogram for concentric circle
clc;close all;clear all;
%radius=input('Enter the radius=');
radius=0.6% Let's assign some value
% (c,d)are the center coordinate.
c=[-1,0,-0.5];
d=[0,0,-0.5,];
%colormap jet;
for i=1:3
[x1,y1]=getCircle([c(i),d(i)],radius)
plot(x1,y1,'linewidth',2);
%%%%%below instruction generate black and white version
%plot(x1,y1,'linewidth',2,'color','k');
%%%%%%below instruction plots the RGB value [.5 .4 .7],
%%%%%%If you want lots of color names, you could use the rgb
function
%%%%%%to return the RGB values of just about any color.
%plot(x1,y1,'linewidth',2,'color',[.5 .4 .7]);
hold on
axis equal
end
OUTPUT:
2. Write a MATL AB program to represent three concentric circles as mesh grid in both RGB and gray scale version( for clear idea see the below figure 2) (25 Marks) 50 100 150 200 5o 100 150 200 Fi...