finding the intersection for a trace to a threshold
이전 댓글 표시
Hi I am trying to find the points of intersection of a trace compared to a threshold. Let me explain, I have the trace of the movement of the foot in the z axis (raising the toe and putting it back to the floor in a step) and I want to find the points of intersection of a determined threshold (which is 5 mm above the minimum point of the swing of the toe). I have tried codes that I have found around but I need something according to my data
zstp=Rtoez(mRTO(i):mRHS(i));
t1M=find(islocalmax(nzstp,'MaxNumExtrema',1));
tmin=find(islocalmin(nzstp(t1M:end)))+t1M-1;
tclear=zstp(tmin);ntclear=nzstp(tmin);
traise=nzstp(t1M);
%% Determining the initial threshold
cutoff=round(ntclear+5)*ones(size(nzstp,1),1);
if cutoff > (ntclear+5)
cutoff=cutoff-1;
end
So now I need the intersects of nzstp to cutoff, so I can calculate the area under the threshold but above the curve
채택된 답변
추가 답변 (1개)
Turlough Hughes
2019년 10월 4일
I'm not sure which variable you use to represent your x data, but lets call it x, where x is the same size as nzstp and cutoff.
[xi, yi]=polyxpoly(x,nzstp, [x(1) x(end)],[cutoff(1) cutoff(end)]);
hold on; plot(xi,yi,'^k')
The inputs are your curve data and the start and end points for your threshold line which I have written as
x,nzstp % curve data
[x(1) x(end)],[cutoff(1) cutoff(end)] %start and end point of threshold line
Note you may need to download the mapping toolbox if you dont already have it installed in order to you polyxpoly.
카테고리
도움말 센터 및 File Exchange에서 Computational Geometry에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

