MATLAB: Alternative command to ‘find’

findopti toolboxscip

Hello, i am trying to declare this nonlinear constraint in opti toolbox using scip solver. I just want to ask if there is an alternative command for 'find'
nlcon3= @(x) [x(9*N+(find(x(9*N+1:10*N),1,'first')))* x(9*N+(find(x(9*N+1:10*N),1,'first'))+1)*x(9*N+(find(x(9*N+1:10*N),1,'first'))+2)*x(9*N+(find(x(9*N+1:10*N),1,'first'))+3)*x(9*N+(find(x(9*N+1:10*N),1,'first'))+4)];
nlrhs3 =1;
nle3 =1;
Thank you for your support.

Best Answer

nlcon3= @(x) product(x((0:4) + x(9*N+(find(x(9*N+1:10*N),1,'first')));