Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function matrix = task_matrix(matrix)
- [N,M] = size(matrix);
- c = 1;
- for i = 1:M
- sum = 0;
- for j = 1:N
- sum = sum + matrix(j,i);
- end
- if ( sum / N < 0 )
- for k = i:(-1):c+1
- for j = 1:N
- matrix(j,k) = matrix(j,k-1);
- end
- end;
- for j = 1:N
- matrix(j,c) = 0;
- end
- c = c + 1;
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement