How to plot (x,y)

조회 수: 1 (최근 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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by