Facing problem with plot function

30 ビュー (過去 30 日間)
Arindam
Arindam 2026 年 1 月 21 日 19:51
コメント済み: Star Strider 2026 年 1 月 22 日 5:27
I am trying to plot stress vs strain but the how can i remove the line between the first and last point when my data does connect those two points. Is it problem of plot function? how to i do it cause the scatter function does not look good as i want continuous plot

回答 (2 件)

Fangjun Jiang
Fangjun Jiang 2026 年 1 月 21 日 20:03
plot it with a marker, e.g. plot(Strain, Load,'+')

Star Strider
Star Strider 約21時間 前
The first and last p[oints apparently have the same coordinates.
If your data ars sorted, for example by the x-coordinates, remove the last point in the data.
x = linspace(1, 11, 25).';
y = 30 - (x/10).^4;
xy = [0 0; x y; 0 0];
disp(xy)
0 0 1.0000 29.9999 1.4167 29.9996 1.8333 29.9989 2.2500 29.9974 2.6667 29.9949 3.0833 29.9910 3.5000 29.9850 3.9167 29.9765 4.3333 29.9647 4.7500 29.9491 5.1667 29.9287 5.5833 29.9028 6.0000 29.8704 6.4167 29.8305 6.8333 29.7820 7.2500 29.7237 7.6667 29.6545 8.0833 29.5731 8.5000 29.4780 8.9167 29.3679 9.3333 29.2412 9.7500 29.0963 10.1667 28.9316 10.5833 28.7454 11.0000 28.5359 0 0
figure
plot(xy(:,1), xy(:,2))
grid
axis([-1 12 -1 35])
title('Original Data')
xy = xy(1:end-1,:); % Eliminate The Repeated Last Row
disp(xy)
0 0 1.0000 29.9999 1.4167 29.9996 1.8333 29.9989 2.2500 29.9974 2.6667 29.9949 3.0833 29.9910 3.5000 29.9850 3.9167 29.9765 4.3333 29.9647 4.7500 29.9491 5.1667 29.9287 5.5833 29.9028 6.0000 29.8704 6.4167 29.8305 6.8333 29.7820 7.2500 29.7237 7.6667 29.6545 8.0833 29.5731 8.5000 29.4780 8.9167 29.3679 9.3333 29.2412 9.7500 29.0963 10.1667 28.9316 10.5833 28.7454 11.0000 28.5359
figure
plot(xy(:,1), xy(:,2))
grid
axis([-1 12 -1 35])
title('Slightly Edited Data')
.
  2 件のコメント
Sam Chak
Sam Chak 約15時間 前
Technically, the plot completes the loop because it appears that when the force on the specimen is suddenly removed, the load immediately drops to zero, and the specimen somehow seemingly returns to its original shape (the pre-elongated state, ). However, if the last point is intended to be at the fracture point, then the stress would drop to zero while the strain remains at its maximum value.
Star Strider
Star Strider 約13時間 前
@Sam Chak -- Thank you!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStress and Strain についてさらに検索

タグ

製品


リリース

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by