필터 지우기
필터 지우기

How can I plot this?

조회 수: 2 (최근 30일)
NASA
NASA 2020년 4월 12일
편집: Image Analyst 2020년 4월 12일
produce a plot of V for characteristic impedance values ranging from Z0 = 0.01; 0.1; 1; 10; 100; 1000; 10000 and for values of ZL = 1x10^-3 to 1x10^6. Use a step size for ZL of 1. Plot your results on a Semi-logarithmic plot with the horizontal axis as the log scale. You should have 1 plot with 7 curves on it. where V = (ZL - Z0 / ZL + Z0)
I wrote this code:
ZL = 10^-3:1:10^6;
Z0 = [0.01, 0.1, 1, 10, 100, 1000, 10000];
V = (ZL - Z0)/(ZL+Z0);
I got this: matrix dimensions must agree
I used .- and .+
it said wrong operator
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 4월 12일
hint:
(1:2).' + (3:5)
hint: .+ and .- do not exist as operators, but ./ does.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2020년 4월 12일
Use a for loop:
Here's a start.
ZL = 10^-3:1:10^6
Z0 = [0.01, 0.1, 1, 10, 100, 1000, 10000]
for k = 1 : length(Z0)
thisZ0 = Z0(k);
V = (ZL - thisZ0) ./ etc.
plot(.....etc.
hold on
end
See if you can finish it.
  댓글 수: 2
NASA
NASA 2020년 4월 12일
it worked thanks, can i do the scaling inside the loop?
Image Analyst
Image Analyst 2020년 4월 12일
편집: Image Analyst 2020년 4월 12일
Sure. Or use semilogx().

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by