3D arrays manipulation and use of if else statments
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mantas Vaitonis
el 21 de Jun. de 2018
Abierta de nuevo: Mantas Vaitonis
el 25 de Jun. de 2018
Hello Everyone,
Here is the situation. There are three 3D arrays. S (1x5x1000) that stores elements from 1:5, P (1x5x1000) that stores pairs for S, and idx (1x5x1000) to invoke pair. For example S is always the same and (1x5x1)=1 2 3 4 5, p (1x5x1)=3 1 5 2 3 and idx (1x5x1)=1 0 1 1 1. We have the situation where are two same (5-3 and 3-5) pairs with invoke signal, we need to change invoke signal from 1 to 0 that would look like 1 0 0 1 1, and we need to do this for the whole 3D array. Is there a way to achieve this without for loop, because this part is time sensitive? Simplified code
if idx(i)==1
if p(i)=s(p(i))
idx(i)=0
end
end
Respuestas (0)
Ver también
Categorías
Más información sobre Matrices and Arrays 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!