Documente Academic
Documente Profesional
Documente Cultură
Lenguaje de Programación
ARREGLOS
1/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
Memoria
Notas
(1) 5.3
Notas(1)=input(‘……’);
Notas(2)=input(‘……’);
(2) 4.7
.
. for i=1:n
Notas(i)=input(‘……’);
(i) 2.1 end
.
.
(n) 6.0
2/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
Memoria Pantalla
Lab 1 = 5.3
Notas Lab 2 = 4.7
(i) 2.1
.
.
(n) 6.0
Pantalla
Lab 1 = 5.3
Lab 2 = 4.7
.
for i=1:n .
fprintf(1,’\n Lab %2.0f = %3.1f’,i,Notas(i)); Lab i = 2.1
.
end .
Lab n = 6.0
3/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
Memoria
(1) 5.3
Pantalla
(2) 4.7 Promedio = 4.9
P=0;
. for k=1:n
. P=P+Notas(k);
end
(i) 2.1
P=P/n;
. fprintf(1,’\n Promedio = %3.1f’,P);
.
(n) 6.0
4/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
clear all
clc Memoria Pantalla
% Ingrese N° de notas: _
n=input(‘Ingrese N° de notas: ’); Notas Ingrese Nota 1: _
Ingrese Nota 2: _
for i=1:n (1) .
5.3
fprintf(1,’\n Ingrese Nota %0.0f: ’,i); .
.
Notas(i)=input(‘’); (2) 4.7 Ingrese Nota n: _
end
% (3) 5.7
P=0;
for k=1:n Pantalla
(4) 2.1
P=P+Notas(k); Promedio = 5.6
end
(5) 4.1
P=P/n;
%
(6) 6.0
clc
fprintf(1,’\n Promedio = %3.1f’,P);
close all
5/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
PROBLEMA
6/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
PROBLEMA
7/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
ARREGLOS BIDIMENSIONALES
8/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
ARREGLOS BIDIMENSIONALES
9/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
PROBLEMA
10/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
PROBLEMA
11/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
PROBLEMA
12/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
PROBLEMA
13/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
PROBLEMA
Ingresar la matriz
Imprimir la matriz en pantalla
Desplazar todas las columnas una posición hacia la derecha
Desplazar todas las filas una posición hacia abajo
Desplazar todas columnas hacia la derecha y todas las filas hacia abajo
14/15
ESTRUCTURAS DE DATOS
Lenguaje de Programación
PROBLEMA
15/15