plotting for cosine wave

조회 수: 2 (최근 30일)
Ali Roshanzamir
Ali Roshanzamir 2020년 8월 4일
댓글: Ali Roshanzamir 2020년 8월 4일
Hey guys.
I need to plot this curve. The teta should be 90 and I neesd to plot it for teta 0~360. Can you please help me?
N=45;
teta=90;
Na1=2*N*cos(teta);
Nb1=2*N*cos(teta-30);
Nc1=2*N*cos(teta-60);
Na2=2*N*cos(teta-90);
Nb2=2*N*cos(teta-120);
Nc2=2*N*cos(teta-150);
plot(teta,Na1+Nb1+Nc1+Na2+Nb2+Nc2)

답변 (1개)

Rafael Hernandez-Walls
Rafael Hernandez-Walls 2020년 8월 4일
I change some lines....
N=45;
theta=0:360; % range of values of theta
Na1=2*N*cosd(theta); % cosd for cos when you use degree
Nb1=2*N*cosd(theta-30);
Nc1=2*N*cosd(theta-60);
Na2=2*N*cosd(theta-90);
Nb2=2*N*cosd(theta-120);
Nc2=2*N*cosd(theta-150);
plot(teta,Na1+Nb1+Nc1+Na2+Nb2+Nc2)
  댓글 수: 1
Ali Roshanzamir
Ali Roshanzamir 2020년 8월 4일
Thank you very much. Actually I need a constant theta=90 and I need to plot it for 360 degree. I don't want the variable theta. If possible please consider this as well.
thanks

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by