Advertisement
ostyleo

Untitled

Nov 30th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.21 KB | None | 0 0
  1. A = zeros (4,6);
  2. for i = 1:4,
  3.    for j = 1:6,
  4.        if i == j,
  5.           A(i,j) = 5;
  6.        elseif abs(i-j) == 1,
  7.           A(i,j) = 1;
  8.        else
  9.            A(i,j) = 4;
  10.        end
  11.    end
  12. end
  13.  
  14. A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement