필터 지우기
필터 지우기

Deleting Values Less Than Maximum Value

조회 수: 2 (최근 30일)
mike
mike 2014년 12월 7일
댓글: mike 2014년 12월 7일
Hey guys,
I imported an excel sheet (force and strain values from a tensile test) and when I removed the extensometer, the strain values repeat themselves. The maximum value of the strain occurs when the extensomoter is removed and after that, the strain repeats itself until the test is over. I was wondering if there was a loop I could write that would remove the repeating strain values so I can plot them.
So far I have tried:
for Strain_Norm == Strain_Max
Strain_Norm = [];
for Strain_Norm < Strain_Max
Strain = Strain_Norm;
end
end
I want to be able to just plot the strain values that do not repeat themselves. I know I can use the unique function, but some of my data points repeat themselves once or twice before the extensometer is removed, and I will still like to plot those points.
I am new at Matlab and am wondering if that is even the correct syntax I appreciate all and any help THanks!
  댓글 수: 1
Star Strider
Star Strider 2014년 12월 7일
It might be helpful if you plotted your raw data and then uploaded a .png of the plot here. (The easiest way is to use the figure UI functions to save the plot as a .png image.) Then upload it here using the ‘picture’ icon.
Right now, we’re just guessing what your data look like. The problem with that is that we may not all be guessing the same thing.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2014년 12월 7일
편집: Image Analyst 2014년 12월 7일
I answered something fairly similar to that in your duplicate question http://www.mathworks.com/matlabcentral/answers/165706#comment_254347
Try this:
% Find rows that have strain values of "the maximum strain value";
rowsToDelete = strain >= Strain_Max;
% We don't want those rows because they are bad data.
% So delete those rows from the strain array.
strain(rowsToDelete) = [];
% Delete those rows from the force array also.
force(rowsToDelete) = [];
You might want to do
rowsToDelete = strain >= (Strain_Max - tolerance);
just in case there are values that are pretty high - higher than acceptable - but not exactly the max.
  댓글 수: 1
mike
mike 2014년 12월 7일
Thanks! Sorry I didn't realize I asked the same question twice

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by