How to choose the spcific intersection of two arry
2 ビュー (過去 30 日間)
古いコメントを表示
how can I change the function so I could make it only return the intersection on the right, now it return the intersection point on the left.
Thank You !

The functioin I use:
function [maxSpeed,thrustDragVal] = maxSpeedThrustCalc(V, thrust, drag)
for difference = drag - thrust
[m,i] = min(abs(difference));
if (abs(difference) == m)
maxSpeed = V(i);
thrustDragVal = thrust(i);
end
end
end
0 件のコメント
採用された回答
David Hill
2020 年 4 月 21 日
function [maxSpeed,thrustDragVal] = maxSpeedThrustCalc(V, thrust, drag)
i=find(abs(drag-thrust)<.1,1,'last');%not sure what tolerance you need
maxSpeed = V(i);
thrustDragVal = thrust(i);
end
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!