Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc;clear all;
- %%a) create vectors
- c=1:1:100;
- d=1:2:200;
- %%b)creating matrixes
- C=make10x10(c);
- D=make10x10(d);
- disp(C);disp(D);
- %%c)submatrix
- E=C(3:5,5:8);
- disp(E);
- %%d)submatric with a step <>1
- F=D(2:2:8,1:3:7);
- disp(F);
- %%e)matrix multiplication
- G=E*F;
- e=diag(G);
- disp(e);
- %%f)inversion and random numbers
- random_matrix=0+10*rand(3,3);
- H=G-random_matrix;
- disp(det(H));
- disp(inv(H));
- function [C]=make10x10(c)
- j=1;
- C=zeros(10);
- for i=1:10
- C(i,:)=c(j:j+9);
- j=j+10;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement