How do I plot a function of one variable easily in matlab?
Mostrar comentarios más antiguos
I am expecting to receiving 5 values for Z1 back but only receive 1. Could anyone explain this? I am trying to let f vary and receive different values of Z1.
This is the code I'm using:
e = 8.85*10^-12
c = 3*10^8
a = 0.02286
u = 4*pi*10^-7
f = 8*10^9:1*10^9:12*10^9;
Z1 = (((2*pi*f*sqrt(u*e))*sqrt(u/e))/(sqrt((((2*pi*f)/c).^2)-((pi/a)^2))));
plot(f,Z1)
Respuestas (1)
Use element-wise multiplication and division operators:
e = 8.85*10^-12;
c = 3*10^8;
a = 0.02286;
u = 4*pi*10^-7;
f = 8*10^9:1*10^9:12*10^9;
Z1 = (((2.*pi.*f.*sqrt(u.*e)).*sqrt(u./e))./(sqrt((((2.*pi.*f)./c).^2)-((pi./a).^2))));
plot(f,Z1)
Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
