Create X-axis limit?

4 次查看(过去 30 天)
Hi all,
I have a plot created from the following code
close all
gm = 1e-6:1e-3:1;
grid on
hold on
%Rd = 1K
einv = 2.*sqrt((4e-9)^2+(4.*1.38e-23.*298.15.*1e3))
plot(gm,einv./(gm*1e3),'color',[0,0,0]);
%Rd = 10K
einv = 2.*sqrt((4e-9)^2+(4.*1.38e-23*298.15*10e3))
plot(gm,einv./(gm*10e3),'color',[0.25,0.25,0.25]);
%Rd = 100K
einv = 2.*sqrt((4e-9)^2+(4.*1.38e-23*298.15*100e3))
plot(gm,einv./(gm*100e3),'color',[0.5,0.5,0.5]);
%Rd = 1M
einv = 2.*sqrt((4e-9)^2+(4.*1.38e-23*298.15*1e6))
plot(gm,einv./(gm*1e6),'color',[0.75,0.75,0.75]);
xlabel ('gm (S)'); ylabel ( 'EINV_{min} (V/sqrt(Hz))');
set(gca,'xscale','log')
set(gca,'yscale','log')
legend('1K\Omega','10K\Omega','100K\Omega','1M\Omega');
%print('einv','-dpng')
Which yields the following
However, I want to implement a limit on the y-axis at 5e-9. I would like the plot to not just chop off the data below 5e-9 but rather to create a limit so that the plots asymptote towards this value. Something like this (Sorry for the crude drawing, though this is just to help get the idea across...)
Can this be done? If so, would anybody be so kind to show me how I can achieve this?
Thank you in advance.

采纳的回答

Image Analyst
Image Analyst 2017-6-11
How about if you just add 5e-9 to all numbers:
close all
gm = 1e-6:1e-3:1;
grid on
hold on
%Rd = 1K
einv = 2.*sqrt((4e-9)^2+(4.*1.38e-23.*298.15.*1e3))
einv = einv./(gm*1e3) + 5e-9;
plot(gm,einv,'color',[0,0,0], 'LineWidth', 2);
%Rd = 10K
einv = 2.*sqrt((4e-9)^2+(4.*1.38e-23*298.15*10e3))
einv = einv./(gm*10e3) + 5e-9;
plot(gm,einv,'color',[0.25,0.25,0.25], 'LineWidth', 2);
%Rd = 100K
einv = 2.*sqrt((4e-9)^2+(4.*1.38e-23*298.15*100e3))
einv = einv./(gm*100e3) + 5e-9;
plot(gm,einv,'color',[0.5,0.5,0.5], 'LineWidth', 2);
%Rd = 1M
einv = 2.*sqrt((4e-9)^2+(4.*1.38e-23*298.15*1e6))
einv = einv./(gm*1e6) + 5e-9;
plot(gm,einv,'color',[0.75,0.75,0.75], 'LineWidth', 2);
xlabel ('gm (S)'); ylabel ( 'EINV_{min} (V/sqrt(Hz))');
set(gca,'xscale','log')
set(gca,'yscale','log')
legend('1K\Omega','10K\Omega','100K\Omega','1M\Omega');
%print('einv','-dpng')
Looks fairly good to me.
  1 个评论
Jason Hodges
Jason Hodges 2017-6-11
Oh boy, silly me. Such a simple solution!
Thank you kindly.

请先登录,再进行评论。

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by