필터 지우기
필터 지우기

Need help to get the minimum absolute value of intersection point

조회 수: 2 (최근 30일)
below are my two vector L1(976x1) and L2(976x101) . i am calculatin the minimum absolute value where they intersecting. the figure below is for the command of
figure, plot(Tspan,y(:,1)), hold on, plot(tspan,SigV(:,81))
so if i run Tspan(rowOfMinValue) and tspan(rowOfMinValue) i am getting different values at column no 81 than the graph for both case.i need the value exactly where they are intersecting.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tspan =[0.0976:-0.0001:0] % Span for L1
Tspan = [0 : 0.0001: 0.0976] % Span for L2
L1 = y( : ,1);
L2 = SigV;
dL =L2(:,1:end)- L1;
columns = length(dL(1,:));
rowOfMinValue = [];
for col = 1 : columns
% Find min value in this column, and it' s row number (index).
[minValue(col), rowOfMinValue(col)] = min(abs(dL(:, col)));
end
% Report to command window:
rowOfMinValue
  댓글 수: 2
Matt J
Matt J 2021년 9월 4일
편집: Matt J 2021년 9월 4일
We can't run your code, because we don't have y or SigV.
md mayeen uddin
md mayeen uddin 2021년 9월 4일
Hi mat, i have attached both y and SigV here. since SigV is (976x101) i just shared you the SigV(: , 81) which is represented in Figure 1

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

채택된 답변

KSSV
KSSV 2021년 9월 4일
  댓글 수: 2
md mayeen uddin
md mayeen uddin 2021년 9월 4일
편집: md mayeen uddin 2021년 9월 4일
This is giving me a precise answer but only for the last column of SigV. i want to Store values for the intersection of everz column. can it be possible?
__________________________________________________________________________
L1 = y( : ,1);
L2 = SigV;
Xf = zeros(length(SigV(1,:)),1);
Yxf =zeros(length(SigV(1,:)),1);
for i = length(SigV(1,:))
[yi(i),xi(i)] = polyxpoly(y(:,1),Tspan,SigV(:,i),tspan);
Xf(i,1) = xi(i);
Yxf(i,1) = yi(i);
end
md mayeen uddin
md mayeen uddin 2021년 9월 4일
it works , thanks a lot KSSV.
for i =1: length(SigV(1,:))

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by