Question

2. Write a MATL AB program to represent three concentric circles as mesh grid in both RGB and gray scale version( for clear i

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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:

radius = 0.60000

Add a comment
Know the answer?
Add Answer to:
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...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT