Beruflich Dokumente
Kultur Dokumente
7.0
Juego de instrucciones
para la programación
en MATLAB 7.0
INSTRUCCIONES DE ENTRADA
while condición
Instrucciones de Comando
end
INSTRUCCIONES PARA EL CONTROL
DE FLUJO
if condición
comandos
end
INSTRUCCIONES PARA EL CONTROL
DE FLUJO
If condición1
comandos1
else
comandos2
end
INSTRUCCIONES PARA EL CONTROL
DE FLUJO
If condición1
comando1
elseif condición2
comando2
elseif condición3
comando3
.
else
end
INSTRUCCIONES PARA EL CONTROL
DE FLUJO
try
instrucción
…..
instrucción
catch
instrucción
…..
end
INSTRUCCIONES DE SALIDA
Ejemplo:
A=rand(3,4)
try
f=input(‘Ingrese la fila ’);
g=input(‘Ingrese la columna ’);
n=A(f,g)
disp{[‘A(’ num2str(f) ‘,’ num2str(g) ‘) = ’ num2str(n)]);
catch
disp(‘error’)
end
INSTRUCCIONES PARA EL CONTROL
DE FLUJO