How to choose the spcific intersection of two arry

2 visualizaciones (últimos 30 días)
Felix Hao
Felix Hao el 21 de Abr. de 2020
Respondida: David Hill el 21 de Abr. de 2020
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

Respuesta aceptada

David Hill
David Hill el 21 de Abr. de 2020
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

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by