I'm trying to Plot Pt against length , it's not plotting

1 次查看(过去 30 天)
close all;
Sr=-45;
Ltx=8.52;
Lrx=5.48;
Ma=8;
L=50;
f=0.5;
j=0.12;
n=(L/2)-1;
Pt= Sr + Ltx + f*L + n*j + Lrx + Ma;
OLR= 10e3:1:120e3; % Optical length range (m)
plot(OLR,Pt)
xlabel('C/N ratio in dB---->');
ylabel('Transmitted Power Pt in Watt----->');
title('C/N Versus Pt');
grid on;

采纳的回答

Walter Roberson
Walter Roberson 2022-10-16
Pt= Sr + Ltx + f*L + n*j + Lrx + Ma;
all of the values are scalars. Your computation is independent of OLR
  3 个评论
Walter Roberson
Walter Roberson 2022-10-16
define OLR first then
Pt= Sr + Ltx + f*L + n*j + Lrx + Ma + 0*OLR;
This will have the effect of replicating the value the same size as OLR

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Optics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by