Escolar Documentos
Profissional Documentos
Cultura Documentos
SUPERIORES DE ECATEPEC
“VECTORES O ARREGLOS”
T R A B A J O
P R E S E N T A
D O C E N T E
M. en C. HECTOR ALONSO AKE MIAN
arreglo(10) 0
Para i 1 , 10 , 1
arreglo(i) i
Cierre
Para i 1 , 10 , 1
arreglo(i)
Cierre
Fin
close all
clear all
clc
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('%%% HACER UN PROGRAMA QUE RELLENE UN ARREGLO CON LOS 10 PRIMEROS %%')
disp('%%% NÚMEROS ENTEROS Y LOS MUESTRE EN PANTALLA EN ORDEN %%')
disp('%%% ASCENDENTE %%')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp(' ')
disp(' ')
for i=1:10;
A(i)=i;
end
disp('')
fprintf("El arreglo queda de la siguiente forma:")
disp(A)
1
Inicio
arreglo(10) 0
Para i 1 , 10 , 1
arreglo(i) i
Cierre
Para i 10 , 1 , -1
arreglo(i)
Cierre
Fin
close all
clear all
clc
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('%%% HACER UN PROGRAMA QUE RELLENE UN ARREGLO CON LOS 10 PRIMEROS %%')
disp('%%% NÚMEROS ENTEROS Y LOS MUESTRE EN PANTALLA EN ORDEN %%')
disp('%%% DESCENDIENTE %%')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp(' ')
disp(' ')
for i=1:10
fprintf('Ingrese, numero %i ',i);
V(i)=input(':');
end
for j=1:9
for i=1:9
if V(i)<V(i+1)
a=V(i);
b=V(i+1);
V(i)=b;
V(i+1)=a;
end
end
end
fprintf("\nEl arreglo queda de la siguiente forma:")
disp(V)
1
Inicio
arreglo(10) 0
i 0
Para x 1 , 20 , 1
No Si
x mod 2 = 0
arreglo(i) x
i i+1
Cierre
Para x 0 , i -1 , 1
arreglo(x)
Cierre
Fin
close all
clear all
clc
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('%%% HACER UN PROGRAMA QUE RELLENE UN ARREGLO CON NÚMEROS PARES %%')
disp('%%% COMPRENDIDOS ENTRE 1 Y 20 Y LOS MUESTRE EN PANTALLA EN ORDEN %%')
disp('%%% ASCENDIENTE %%')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp(' ')
disp(' ')
j=0;
for i=1:20
if mod(i,2)==0
j=j+1;
A(j)=i;
end
end
disp('')
fprintf("\nEl arreglo queda de la siguiente forma:")
disp(A)
1
Inicio
arreglo(10) 0
i 0
Para x 1 , 20 , 1
No Si
x mod 2 != 0
arreglo(i) x
i i+1
Cierre
Para x i-1 , 0 , -1
arreglo(x)
Cierre
Fin
close all
clear all
clc
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('%%% HACER UN PROGRAMA QUE RELLENE UN ARREGLO CON NÚMEROS PARES %%')
disp('%%% COMPRENDIDOS ENTRE 1 Y 20 Y LOS MUESTRE EN PANTALLA EN ORDEN %%')
disp('%%% DESCENDIENTE %%')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp(' ')
disp(' ')
j=0;
for i=20:-1:1
if mod(i,2)~=0
j=j+1;
A(j)=i;
end
end
disp('')
fprintf("\nEl arreglo queda de la siguiente forma:")
disp(A)
1
Inicio
arreglo(5) 0
suma 0
resta 0
multi 1
div 1
Para i 1 , 5 ,1
'Digite un numero'
arreglo(i)
Cierre
Para i 1 , 5 ,1
Cierre
Fin
close all
clear all
clc
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('%%% HACER UN PROGRAMA QUE LEA 5 NÚMEROS POR TECLADO, LOS %%')
disp('%%% ALMACENE EN UN ARRAY Y MUESTRE LA SUMA,RESTA, MULTIPLICACION %%')
disp('%%% Y DIVISIÓN DE TODO %%')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp(' ')
disp(' ')
sum=0;
res=0;
div=1;
mul=1;
for i=1:5
fprintf('Ingrese, numero %i',i)
V(i)=input(':');
sum=sum+V(i);
res=res-V(i);
mul=mul*V(i);
div=div/V(i);
end
disp('');
disp(V)
disp('');
fprintf('La suma es %i\n',sum)
fprintf('La resta es %i\n',res)
fprintf('La multiplicacion es %i\n',mul)
fprintf('La division es %i\n',div)