필터 지우기
필터 지우기

use rows of matrix sequentially in iterations

조회 수: 1 (최근 30일)
fatema saba
fatema saba 2015년 11월 6일
편집: fatema saba 2015년 11월 6일
Hi I have 2 matrices A and B. each of them has 4 rows and 10 columns. Also, I have the other matrix (D) 100 rows, 100 columns and 6 in third dimension. this matrix is (0-1)matrix. I want to use A and B as index. In fact, my code is something like that:
for it = 1:30
p = randi(80,100,100,6)
for k=1:4
IDX=A(k,:)
JDX=B(k,:)
end
for i:IDX
for j=JDX
s=find(D(i,j,:)==1)
t=s.*p
end
end
end
I hope that in each iteration 100 values for s are determined. and in each iteration one row of A and one row of B are used as IDX and JDX respectively. I mean in iteration 1 for example the first row of A and B, for iteration two the second row of A and B and for iteration 3 the third row and column of A and B. Thank you.
  댓글 수: 2
Stephen23
Stephen23 2015년 11월 6일
Today I formatted your code for you, but in future please do it yourself by selecting the code text and clicking the {} Code button.
Also its helps everyone (yourself included) when you use consistent indentation, like I edited your code to have.
fatema saba
fatema saba 2015년 11월 6일
Thank you Stephen.I try do that. Thanks

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by