Converting a loop into a matrix form. How to do?? Help please.

조회 수: 1 (최근 30일)
Virajan Verma
Virajan Verma 2018년 11월 1일
답변: KSSV 2018년 11월 1일
(b)Element Connectivity Table
for i=1:30
for j=1:27
conn=[j,j+1,j+2]
end
end
Convert this 1x3 matrix into a whole 1 matrix.

답변 (1개)

KSSV
KSSV 2018년 11월 1일
count = 0 ;
conn = zeros([],3) ;
for i=1:30
for j=1:27
count = count+1 ;
conn(count,:) =[j,j+1,j+2] ;
end
end

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by