Facing problem with plot function
32 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Arindam
el 21 de En. de 2026 a las 19:51
Comentada: Star Strider
el 22 de En. de 2026 a las 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
0 comentarios
Respuestas (2)
Fangjun Jiang
el 21 de En. de 2026 a las 20:03
plot it with a marker, e.g. plot(Strain, Load,'+')
0 comentarios
Star Strider
el 21 de En. de 2026 a las 21:20
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)
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)
figure
plot(xy(:,1), xy(:,2))
grid
axis([-1 12 -1 35])
title('Slightly Edited Data')
.
2 comentarios
Sam Chak
el 22 de En. de 2026 a las 3:11
Hi @Arindam
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.

Ver también
Categorías
Más información sobre Stress and Strain en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

