How to plot (x,y)

5 ビュー (過去 30 日間)
John
John 2021 年 3 月 5 日
コメント済み: John 2021 年 3 月 6 日
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);
  5 件のコメント
John
John 2021 年 3 月 6 日
Yes, S11 is S11=1+2*i*Rs*inv(A(1,1)) Since A(1,1) changes with f I should get a different value of S11 for every value of f.
John
John 2021 年 3 月 6 日
OK so I think the issue isn't with the code but with how I am plotting. S11 is a part of S parameters.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by