How do I plot Sinusoidal wave over a circle in Matlab?
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
Accepted Answer
Arthur Reis
on 22 Feb 2022
I'm not sure if I 100% understood your question, but here it is
t = 0:0.01:2*pi; %define interval
x = cos(t);
y = sin(t);
figure;
plot(x,y); %normal circle
%%
f = 10; %define modulation frequency
A = .2; % modulation amplitude
R = A*cos(f*t); %
x = cos(t) + R;
y = sin(t) + R;
figure;
plot(x,y); %similar to your example
%%
x = cos(t).*(1 + R);
y = sin(t).*(1 + R);
figure;
plot(x,y); %modulating the radius
7 Comments
loyyy
on 22 Feb 2022
Hi, thank you for your response. It should be 3 dimensional.
Arthur Reis
on 22 Feb 2022
like so?
t = 0:0.01:2*pi; %define interval
x = cos(t);
y = sin(t);
f = 10; %define modulation frequency
A = .2; % modulation amplitude
R = A*cos(f*t); %
z = R;
figure;
plot3(x,y,z);
loyyy
on 24 Feb 2022
Thank you.
Arthur Reis
on 24 Feb 2022
no problem. If you could please accept an answer so we can close this quesiton.
loyyy
on 6 Mar 2022
Hi @Arthur Reis! Follow up question. If I want to pick 120 points/vertices in the closed curve (equal distances) and extarct their coordinates. What will be the codes then? Hoping you could help me on this problem, as soon as possible. Thank you very much.
Arthur Reis
on 7 Mar 2022
Hello,
you'll only need to change the definition of the 't'. You can use linspace to get an linearly spaced array with expecific number of points (120 in this case). So:
tp = linspace(0,2*pi,120); %new array
xp = cos(tp);
yp = sin(tp);
f = 10; %define modulation frequency
A = .2; % modulation amplitude
Rp = A*cos(f*tp); %
zp = Rp;
figure;
scatter3(xp,yp,zp);
Their coordinates are xp, yp, zp.
Does this solve your problem?
loyyy
on 10 Mar 2022
Yes, Thank you.
More Answers (0)
Categories
Find more on PHY Components in Help Center and File Exchange
Tags
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
