Stress-strain graph
Afficher commentaires plus anciens

I want to make Stress-Strain with linear regression and 0.2% off set graph.
But My code does not show me normal Stress-Strain graph.
I import excel data to matlab. I want to delete First column (start 76) but i cannot deleted.
I want to linear regression from 0 to 593 row data.
can you help me?
AluminumW = readtable("/Users/abc/Downloads/Steel Thursday.TXT");
AluminumW(1:75,:) = [];
AluminumW(593:end,:) = [];
disp = AluminumW(:,2);
force = AluminumW(:,3);
disp1 = table2array(disp);
force1 = table2array(force);
shift1 = disp1 - 0.081994;
shift2 = force1 - 0.11194;
d = 2.54;
r = d/2;
A = pi*r^2;
strain = shift1 / 12.7;
stress = shift2 / A;
figure(1)
plot(strain,stress)
xlabel('Engineering Strain')
ylabel('Engineering Stress (GPa)')
grid on
hold on
x = strain(60) - strain(1);
y = stress(60) - stress(1);
b1 = y / x;
slope = b1*strain;
plot(strain,slope,'g')
hold on
yield = strain + 0.002;
plot(yield,slope,'r')
hold off
Réponses (2)
randerss simil
le 9 Fév 2021
Modifié(e) : randerss simil
le 9 Fév 2021
To delete 1st column
AluminumW(1:75,1) = []; % to delete 1st column
6 commentaires
randerss simil
le 9 Fév 2021
can you attach data file ?
Junway
le 9 Fév 2021
randerss simil
le 10 Fév 2021
graph = readtable('data.xlsx')
plot(table2array(graph(:,1)),table2array(graph(:,2)))

This is what shows from your data file.
But your problem is related to another file ... if i am correct,
If possible can you share the Steel Thursday.txt file which is where the problem is
randerss simil
le 10 Fév 2021
See this new data file which i added a first column.
Then i deleted it using the following command
graph = readtable('datastsr.xlsx')
graph(:,1) =[]
plot(table2array(graph(:,1)),table2array(graph(:,2)))
randerss simil
le 10 Fév 2021
x = table2array(graph(:,1));
y = table2array(graph(:,2));
p = polyfit(x,y,3); % cubic polynomial fit
yfit = polyval(p,x); % poly evaluation
yres = y-yfit; % residuals
plot(x,y,x(1:50:end),yfit(1:50:end),'o','MarkerSize',2,'MarkerFaceColor','y')
grid

If you want you can plot residuals and determine the regression coefficient R
Junway
le 10 Fév 2021
Modifié(e) : Walter Roberson
le 10 Fév 2021
Alfred Muchangi
le 9 Avr 2024
Modifié(e) : Alfred Muchangi
le 9 Avr 2024
0 votes
Could someone please help me with matlab script for plotting stress-strain curve give the following data:Test time, Standard force, Standard travel, Strain, Nominal strain
Catégories
En savoir plus sur Stress and Strain dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
