Está en la página 1de 3

Script 1

num1 = double(input('Ingrese el primer numero: '))

num2 = double(input('Ingrese el segundo numero: '))

if num1 > num2

sprintf('El primer numero, %.2f, es el mayor.',a)

elseif num2 > num1

sprintf('El segundo numero, %.2f, es el mayor.',b)

else

sprintf('Todos los numeros son iguales.')

end

*****************************************************************************

Script 2

edad = double(input('Ingrese su edad: '))

if edad < 4

sprintf('Pelicula recomendada: Buscando a nemo.',edad)

elseif edad >= 5


sprintf('Pelicula recomendada: toy Story.',edad)

elseif edad >= 16

sprintf('Pelicula recomendada: Harry Potter.',edad)

elseif edad >= 28

sprintf('Pelicula recomendada: Star Wars.',edad)

elseif edad >= 40

sprintf('Pelicula recomendada: Forrest Gump.',edad)

elseif edad >= 60

sprintf('Pelicula recomendada: El Padrino.',edad)

end
Script 3

clc

clear all

a = [1 7 8 ;7 3 1;3 4 2]

col_central = a(:,2)

re_central = a(2,:)

d = sum(col_central)

e = sum(re_central)

if(d>=e)

mensaje = 'TRUE'

else

mensaje = 'FALSE'

end

También podría gustarte