alternative command to 'find'
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ditiro Setlhaolo
el 15 de Abr. de 2014
Comentada: Ditiro Setlhaolo
el 16 de Abr. de 2014
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.
0 comentarios
Respuesta aceptada
Walter Roberson
el 15 de Abr. de 2014
nlcon3= @(x) product(x((0:4) + x(9*N+(find(x(9*N+1:10*N),1,'first')));
0 comentarios
Más respuestas (2)
Sean de Wolski
el 15 de Abr. de 2014
Instead of using an anonymous function, you could write that into its own function file and then only call find once, assign the output to a variable and use that variable a few times.
1 comentario
Ditiro Setlhaolo
el 15 de Abr. de 2014
2 comentarios
Walter Roberson
el 15 de Abr. de 2014
I see no evidence that "find" is not compatible with opti toolbox. I do see evidence that it did not work the way you called it. It would have been easier on us if you had given us the same information you gave the OPTI forum in https://groups.google.com/forum/#!topic/opti-toolbox-forum/14YggFfG11s namely that you get an error
Undefined function 'find' for input arguments of type 'scipvar'.
and that
(Remember SCIP only supports a subset of MATLAB commands)
Rather than having us guess about what SCIP does support, you should post a link to that information.
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!