필터 지우기
필터 지우기

how to use for loop on both sides?

조회 수: 1 (최근 30일)
Jisu Yang
Jisu Yang 2019년 5월 27일
댓글: Jisu Yang 2019년 5월 27일
I want a and b are also in loop like:
for a = 1:4
for b = 1:4
how can I use 'for' loop on both sides?
what I wrote is :
for q = [i,j,k,l]
for w = [i,j,k,l]
k_Global[q,w] = k_global[a,b]
end
end

답변 (1개)

KSSV
KSSV 2019년 5월 27일
a = 1:4 ;
b = 1:4 ;
q = [i,j,k,l] ;
w = [i,j,k,l]
for loop1 = 1:4
for loop2 = 1:4
k_Global[q(loop1),w(loop2)] = k_global[a(loop1),b(loop2)]
end
end
  댓글 수: 1
Jisu Yang
Jisu Yang 2019년 5월 27일
Thx a lot!!! :)
It works well!!!!
Thx!!!!

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by