How to plot elongation of bar elements vs number of elements or size of elements?

4 ビュー (過去 30 日間)
MARIA FE
MARIA FE 2023 年 2 月 22 日
コメント済み: MARIA FE 2023 年 3 月 8 日
Hello sir and maam, mayb I ask help regarding plotting of the elongation vs the size or number of elements to see the line of error. Or I uploaded the sample photo I grabbed from one reference, May I ask a basic tutorial on how to do this? Thank you.

回答 (1 件)

Abhijeet
Abhijeet 2023 年 3 月 8 日
Hi Maria,
To plot elongation of bar elements versus the number of elements or the size of the elements in MATLAB, you can use the following steps:
  1. Create a vector of the number of elements or the size of the elements that you want to plot.
  2. Create a vector of the corresponding elongations for each number of elements or size of the elements.
  3. Plot the elongation versus the number of elements or size of the elements using the "plot" function.
  4. Add a logarithmic scale to the x-axis using the "set" function to see the line of error.
Here is an example code to plot the elongation of bar elements versus the number of elements:
% Define the number of elements or size of the elements
nElements = [10 20 30 40 50 60 70 80 90 100];
% Define the corresponding elongations
elongation = [0.0032 0.0016 0.0011 0.0008 0.0006 0.0005 0.0004 0.0003 0.0003 0.0002];
% Plot the elongation versus the number of elements
figure;
plot(nElements, elongation, '-o');
% Set logarithmic scale on the x-axis
set(gca, 'XScale', 'log');
% Add title and axis labels
title('Elongation vs. Number of Elements');
xlabel('Number of Elements');
ylabel('Elongation');
You can modify the code to plot the elongation versus the size of the elements by replacing the "nElements" vector with a vector of the corresponding sizes of the elements.
Thank You

カテゴリ

Help Center および File ExchangeBar Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by