How do I pass extra known parameters to arrayfun?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
cui,xingxing
el 6 de Ag. de 2021
Editada: cui,xingxing
el 6 de Ag. de 2021
For example, if I want to find the position in the corresponding array b from each element of array a, how should I write the code?
a = [1,2,3];
b = [2,1,1,3,1,2];
idx = arrayfun(@(x,b)find(x==b),a,b)
The desired idx outcome is:{[2,3,5],[1,6],[4]}
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Object Programming 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!