Create X-axis limit?

4 Ansichten (letzte 30 Tage)
Jason Hodges
Jason Hodges am 11 Jun. 2017
Kommentiert: Jason Hodges am 11 Jun. 2017
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.

Akzeptierte Antwort

Image Analyst
Image Analyst am 11 Jun. 2017
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 Kommentar
Jason Hodges
Jason Hodges am 11 Jun. 2017
Oh boy, silly me. Such a simple solution!
Thank you kindly.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by