Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Сценарий Pr1_5_3.sce
- function b = posl(M)
- [m,n] = size(M);
- d = M(1,2) - M(1,1);
- b = 1
- for i=1:n
- if M(1,n) - M(1,n-1) ~= d then
- b = 0;
- end
- end
- endfunction
- function mas=task(M)
- [m,n] = size(M);
- c = 1;
- mas = zeros(m,n);
- for i=1:m
- if posl(M(i,:)) == 1 then
- mas(c,:) = M(i,:);
- c=c+1;
- end
- end
- for i=c:m;
- mas(i,:) = [];
- end
- endfunction
- M = input("Введите матрицу ");
- disp("Начальная матрица", M);
- C = task(M);
- disp("Результат", C);
- //Конец сценария Pr1_5_3.sce
- //==========================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement