plot a function wit cos

조회 수: 18 (최근 30일)
Yann
Yann 2023년 1월 11일
댓글: Yann 2023년 1월 11일
here is my code but when i running it i get an error
f=(0:10);
%f0=5*10^9;
c=(3*10^8);
t=5*10^9;
w=2*pi*f;
wt=w*t;
k=(wt/c);
z=(0.75:30);
r12=0.29;
%x=0.094*cos*(k*z);
y=0.094*cos*(((100*pi)/3)*z);
%rin=abs(y);
plot(f,y);
xlabel("Frequency",'fontsize',5);
ylabel("|Γin|",'FontSize', 5);
title("Input reflection coefficient as a function of frequency","fontsize",7.5);
grid on;
that the errore
Error using cos
Not enough input arguments.
Error in project (line 11)
y=0.094*cos*(((100*pi)/3)*z);
i ty to fix it but tey stil have a erro at this line

답변 (2개)

Torsten
Torsten 2023년 1월 11일
f=(0:10);
%f0=5*10^9;
c=(3*10^8);
t=5*10^9;
w=2*pi*f;
wt=w*t;
k=(wt/c);
z=(0.75:30);
r12=0.29;
%x=0.094*cos*(k*z);
y=0.094*cos(((100*pi)/3)*z);
%rin=abs(y);
plot(z,y);
xlabel("Frequency",'fontsize',5);
ylabel("|Γin|",'FontSize', 5);
title("Input reflection coefficient as a function of frequency","fontsize",7.5);
grid on;
  댓글 수: 1
Yann
Yann 2023년 1월 11일
thanks i fixed it

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


Voss
Voss 2023년 1월 11일
Maybe this
y=0.094*cos*(((100*pi)/3)*z);
should be this
y=0.094*cos(((100*pi)/3)*z);
or, without the extra parentheses:
y=0.094*cos(100*pi/3*z);
  댓글 수: 1
Yann
Yann 2023년 1월 11일
yes i see
thanks i fixed it

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

카테고리

Help CenterFile Exchange에서 Bartlett에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by