필터 지우기
필터 지우기

How do I plot Sinusoidal wave over a circle in Matlab?

조회 수: 15 (최근 30일)
loyyy
loyyy 2022년 2월 22일
댓글: loyyy 2022년 3월 10일

채택된 답변

Arthur Reis
Arthur Reis 2022년 2월 22일
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
Arthur Reis
Arthur Reis 2022년 3월 7일
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
loyyy 2022년 3월 10일
Yes, Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by