I need help in creating a stress-load diagram of three different materials
4 次查看(过去 30 天)
显示 更早的评论
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1065705/image.jpeg)
0 个评论
回答(1 个)
Aditya
2023-10-6
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!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stress and Strain 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!