I need help in creating a stress-load diagram of three different materials
Show older comments
I need help in creating a stress-load diagram of three different materials
Material 1 = Mild Steel
Material 2 = Brass
Material 3 = Aluminium
Please help me to find the code, i need have S-N curve graph.

Answers (1)
Aditya
on 6 Oct 2023
Hi Muhammad,
From your query, I understand that you want to plot the S-N curve for the given materials. For this you can utilize the ‘plot’ function available in MATLAB. I have shared the sample code snippet below, which demonstrates the creation of S-N curve for Aluminium using random data.
% Data for S-N curve (stress vs. number of load cycles to failure)
% Format: [stress1, N1; stress2, N2; ...]
aluminium_data = [50, 2000; 100, 1000; 150, 500; 200, 200];
% Plot S-N curve for Aluminium
plot(aluminium_data(:, 2), aluminium_data(:, 1), 'b', 'LineWidth', 2);
% Set plot labels and title
xlabel('Number of Load Cycles to Failure (N)');
ylabel('Stress (S)');
title('Stress-Load (S-N) Diagram');
If you want to plot multiple curves into single graph, you can utilize ‘hold on’ and ‘hold off’ commands.
For better understanding of how to use ‘plot’ function, please refer to this MATLAB documentation:
Hope this helps!
Categories
Find more on Stress and Strain in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!