plot a function wit cos
21 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Torsten
on 11 Jan 2023
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;
Voss
on 11 Jan 2023
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);
See Also
Categories
Find more on Bartlett in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!