3D arrays manipulation and use of if else statments
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 6
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!