How to plot (x,y)

2 Ansichten (letzte 30 Tage)
John
John am 5 Mär. 2021
Kommentiert: John am 6 Mär. 2021
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 Kommentare
John
John am 6 Mär. 2021
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 am 6 Mär. 2021
OK so I think the issue isn't with the code but with how I am plotting. S11 is a part of S parameters.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by