How to plot (x,y)
6 次查看(过去 30 天)
显示 更早的评论
Hi. I'm have to plot variables x and y.
I know the range of x.
Now here's where I'm confused, I have 2 other variables, let's call them a and b
a depends on x;
b depends on a;
y depends on b. So indirectly y depends on x. Does y need to be a variable or vector? How do I plot (x,y)? The code below contains matrices but the idea is what's defined above.
Thanks for your help
clc
clear all
f=3.4:0.01:3.8;
BW=0.4;
fo=3.6;
Rs=0.982472;
Rl=0.982472;
I=eye(8);
S11=zeros(1,41);
M=[0 -0.8231 0 0 0 0 0 0;-0.8231 0 -0.59170 0 0 0 0.0251 0; 0 -0.5917 0 -0.5516 0 -0.0781 0 0;0 0 -0.5516 0 -0.4925 0 0 0;0 0 0 -0.4925 0 -0.5516 0 0;0 0 -0.0781 0 -0.5516 0 -0.5917 0;0 0.0251 0 0 0 -0.5917 0 -0.8231; 0 0 0 0 0 0 -0.8231 0];
R=[Rs 0 0 0 0 0 0 0 ; 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 Rl];
for b=3.4:0.01:3.8
lambda=fo/BW*((b/fo)-(fo/b));
A=lambda*I-R*i+M;
for x=1:
S11(1,x)=1+2*i*Rs*inv(A(1,1));
S11(1,x)=sqrt((real(S11(1,x)))^2+(imag(S11(1,x)))^2);
S11(1,x)=10*log(S11(1,x))
end
end
plot(f,S11);
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!