programacion en matlab.txt

download programacion en matlab.txt

If you can't read please download the document

Transcript of programacion en matlab.txt

function s=sumamatrices1(a) s=0; n=length(a) for i=1:n s=s+( (a(i*i)) ); endend function s=sumamatrices2(a,b) [r,c]=length(a) s=zeros(1:r) for i=1:r s=0; for j=1:c s=s+( (a(i*j)*(b(j)) ); end s(i)=s; endendfunction s=sumamatrices3(a) [r,c]=length(a); for i=1:r s=0; for j=1:c s=s+(a(i*j)) end endendfunction s=sumamatrices4(a) [r,c]=length(a) for i=1:r s=0; for j=1:c s=s+(a(i*j)) end endendfunction s=sumamatrices7(a) [r,c]=length(a) for i=1:r s=0; for j=1:c s=s+( (a)(i*j)+(b(i*j)) ); end endendfunction s=sumamatrices8(a,b) [r,c]=length(a); for i=1:r s=0; for j=1:c s=s+((a(i*j)-(b(i*j) ) ); end endendfunction s=sumamatrices9(a,b) [r,c]=length(a); for i=1:r s=0; for j=1:c s=s+( (a(i*j))/(b(i*j)) ); end endendfunction s=sumamatrices10(a,b) [r,c]=length(a); for i=1:r s=0; for j=1:c; s=s+( (a(i*j))*( b(i*j)) ); end endend function s=sumamatrices11(a,b) [r,c]=length(a) for i=1:r s=0; for j=1:c s=s+( (a(i*j) ) ^ (b(i*j)) ); end endendfunction s=suma12(a) [r,c]=length(a); for i=1:r s=0; for j=1:c s=s+(a(i*j)>=5); end endendfunction s=suma13(a) [r,c]=length(a); for i=1:r s=0; for j=1:c s=s+( (5