plot a function wit cos
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Torsten
am 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
am 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);
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!