I am sure there are other more subtle ways to go about it but this seems about as fast as I can make it for a general brute-force solution (0.11s)
This one seems to work for the large test case, too, although it is not a general solution [for size(p,1)>100 it only tests corner points].
Find the sum of all the numbers of the input vector
31942 Solvers
How to find the position of an element in a vector without using the find function
2477 Solvers
Solve the set of simultaneous linear equations
273 Solvers
73 Solvers
281 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!