A=zeros(3,4)
A =
0 0 0 0 0 0 0 0 0 0 0 0
>> [nRows,nCols] = size(A); A(1:(nRows+1):nRows*nCols) = 1
A =
1 0 0 0 0 1 0 0 0 0 1 0Appreciate your kind assistance on how can I write so that my matrix becomes :A=[1 1 0 0; 0 1 1 0; 0 0 1 1]Thanks
Best Answer