MATLAB is not plotting my constant value plot. Why so?

1 回表示 (過去 30 日間)
Jaikrishnan Mahalekshmi Sahasranamam
Jaikrishnan Mahalekshmi Sahasranamam 2019 年 5 月 29 日
clc
close all
clear
bw=100e3;
FS=2e-9;
IBQN_dBFS=-76.1;
P_IBN=(10^(IBQN_dBFS/10))*(0.5*((FS/2)^2));
PSDnin1=sqrt((P_IBN)/(bw));
figure(1)
plot(linspace(0,bw,10),PSDnin1)
% loglog(linspace(0,bw,10),PSDnin1)
xlabel('Frequency(Hz)')
ylabel('PSDin(A2/Hz)')
axis auto
This is my matlab code and i would like to plot the constant value of PSDnin = 3.5e-15 as a constant line from 0 to bw. I get an empty graph.
Is it plotting and I am unale to see?
Is it because of the lower value? I tried the loglog plot. But it doesnt help. Please help me to resolve the issue.

採用された回答

Jan
Jan 2019 年 5 月 29 日
編集済み: Jan 2019 年 5 月 29 日
The code does draw some points. You see them, if you use a marker:
plot(linspace(0,bw,10), PSDnin1, 'o')
or with a line:
plot(linspace(0,bw,10), repmat(PSDnin1, 1, 10))
The documentation of plot mentions:
If one of X or Y is a scalar and the other is either a scalar or a vector, then the plot function plots discrete points. However, to see the points you must specify a marker symbol, for example, plot(X,Y,'o').
  1 件のコメント
Jaikrishnan Mahalekshmi Sahasranamam
Jaikrishnan Mahalekshmi Sahasranamam 2019 年 5 月 30 日
編集済み: Jaikrishnan Mahalekshmi Sahasranamam 2019 年 5 月 30 日
Hey Jan,
Yes that worked. Great!!.
This one also worked giving a straight line
semilogy([0,bw],[PSDnin1,PSDnin1])
or
plot([0,bw],[PSDnin1,PSDnin1])
Thanks a lot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLabels and Styling についてさらに検索

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by