MATLAB: I want to ask about this matlab code. I can not understand the function of it. It meshes for plates. However, I have limited matlab knowledge and the expression became very confusing for me. Can anyone help me on the code in detail? Thanks .

appending rows to a matrixMATLAB

edof=[];
for i=2*(ELx+1)+1:2*(ELx+1):2*(ELx+1)*(ELy+1)
for j=0:2:2*ELx-1
edof = [edof; [i+j+(1:4)-(2*(ELx+1)+1) [3 4 1 2]+i+j-1]];
end
end

Best Answer

It looks like it's building up a N row by 4 column matrix by appending new rows. At each iteration it tacks on another 4-element vector
[i+j+(1:4)-(2*(ELx+1)+1) [3 4 1 2]+i+j-1]
as another row in a matrix called edof.