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

2 visualizaciones (últimos 30 días)
Virajan Verma
Virajan Verma el 1 de Nov. de 2018
Respondida: KSSV el 1 de Nov. de 2018
(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.

Respuestas (1)

KSSV
KSSV el 1 de Nov. de 2018
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

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by