Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Plot:Connect few points and form a line
Replies: 0

 HsiaoTing Ko Posts: 1 Registered: 11/12/13
Plot:Connect few points and form a line
Posted: Nov 12, 2013 4:30 PM

%Elastic Modulus--YM=YA=Y(MPa)
Y=62000;

%Transformation Temp(degree C)
MF=10;
MS=17;
AS=31;
AF=44;

%Transformation Constatns--CM=CA=C(MPa/degree)
C=7;

%Max Recoverable Strain
SL=0.06;

%Room Temp--theta(degree)
theta=23;

Tb=C*(AF-MS);

Tc=Tb+C*(MS-MF);

Td=Tc-C*(AS-MF);

T= Tb:Tc;

%Fraction of Martensite--Xi
Xi3=(0.5).*cos((3.14159).*((theta-(T/C)-MF)./(MS-MF)))+(0.5);

Sb=Tb/Y;

Sc=Sb+SL*Xi3;

Sd=Sc-(Tc-Td)/Y;

Strain=[0 Sb Sc3 Sd];
Stress=[0 Tb Tc Td];

plot(Strain,Stress)
axis([ 0 0.065 0 250])

I am trying to connect point Sb Tb &Sc Tc& Sd Td together as a line, but the problem is that value between location B to C changes

Matlab gives me an error of "Vectors must be the same lengths."

I think because I have T range from Tb to Tc (T=Tb:Tc) and this is the reason give me error. Is there anyway to fix it? I run fine without having T in the range, but as a solid number.

Thank you