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

José-Luis
José-Luis 2014년 9월 8일
What do you mean by a 2% offset? Translation to the right? Translation upwards?
Chris
Chris 2014년 9월 8일
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.

댓글을 달려면 로그인하십시오.

 채택된 답변

José-Luis
José-Luis 2014년 9월 8일

0 개 추천

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

Chris
Chris 2014년 9월 8일
Alright my bad I should have explained it better. I have to graph a line with a certain slope of 1.3e6 %2 to the right of the initial graph
José-Luis
José-Luis 2014년 9월 8일
2% of what?
Chris
Chris 2014년 9월 8일
2% of the intial graph. So I guess I need to move my second graph which has to have a constant slope .002 to the right of my intial. Kind of like this.
José-Luis
José-Luis 2014년 9월 8일
I am sorry but you ar still not answering my question. 2% of the minimum value of the left graph. 2% of the maximum value of the left graph? 2% of the average value of the left graph?
In any case, once you have defined the offset, it boils down to finding the equation of a line with know slope passing through a certain point (x+offset,y).
Chris
Chris 2014년 9월 8일
So hopefully this clears it up a little more. 2% just have to move it 2%of the max. I have the slope but I am trying to find where it passes through the initial graph, thats my goal.So since I have the slope do I just input a constan line? even though I dont know b for the equation of the line
You have the slope and you know where the line passes:
y = mx + p; %you know m, y and x;
p = y - mx; %y does not change, x is the 2% offset
your_line =@(x) m.*x + p; %replace m and p by their actual values
fplot(your_line,[lower_limit upper_limit]);
Chris
Chris 2014년 9월 8일
Got it. Thanks for bearing with me!
José-Luis
José-Luis 2014년 9월 8일
My pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

질문:

2014년 9월 8일

댓글:

2014년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by