You are on page 1of 1

function [V]=vector(V)

a=max(max(V));
b=sum(min(V));
c=sum(diag(V));
d=V(1,3);
e=V(2,2);
f=V(3,1);
m=d+e+f;
V=(1:3);
V(1)=a;
V(2)=b;
if c>m
V(3)=m;
elseif c<m
V(3)=c;
else
V(3)=c;
end
end

A=[]
for i=1:3
for j=1:3
A(i,j)=input('Ingrese numero: ');
end
end
V=vector(A);
disp(A);
disp(V);

You might also like