How to plot a offset in a graph

53 vues (au cours des 30 derniers jours)
Chris
Chris le 8 Sep 2014
Commenté : José-Luis le 8 Sep 2014
Alright so I need to plot my graph with a 2% offset to find my yield strength. I am unsure how to go about doing this. This is what I have right now so I just need to add a 2% offset to my graph.
li=a(:,[2]).*.0392700787; % Convert mm to in
P=a(:,[3]).*224.808943; % Convert kN to lbf
Di=(2.53*.0392700787);
Ao=pi/4*Di^2;
lo=(26.11*.0392700787);
Si=P/Ao;
ei=li/lo;
plot(ei,Si)
xlabel('Strain (in/in)')
ylabel('Stress (lb/in^2)')
title('Stress vs Strain 4140 Steel')
  2 commentaires
José-Luis
José-Luis le 8 Sep 2014
What do you mean by a 2% offset? Translation to the right? Translation upwards?
Chris
Chris le 8 Sep 2014
Oh sorry. I need to graph the same graph parallel to it %2 to the right of the intial graph. so they are parallel to eachother.

Connectez-vous pour commenter.

Réponse acceptée

José-Luis
José-Luis le 8 Sep 2014
I am not sure I understand what you want to achieve.
x = sort(rand(10,1));
y = sort(rand(10,1));
plot(x,y,'b-')
hold on
plot(1.02.*x,y,'r-')
Note that the graphs are not entirely parallel, but 2% is a relative measure and I do not see how you interpret it.
  8 commentaires
Chris
Chris le 8 Sep 2014
Got it. Thanks for bearing with me!
José-Luis
José-Luis le 8 Sep 2014
My pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by