Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A.-
if mod(n,2)==0,
else
end
PAR O IMPAR
B.-
if (n>=0&m>=0);
else
end
SUMA O PRODUCTO
C.-
>> fprintf(' EL MENOR VALOR ES \n');
x=[0 0 0 0 0]
r=sort(x),
EL MENOR VALOR ES
x=
0 0 0 0 0
r=
5 23 88 1988 2007
r=
5 23 88 1988 2007
>>
D.-
a=input('ingrese a: ');
b=input('ingrese b: ');
c=input('ingrese c: ');
if a>0
R1=(-b+sqrt(b^2-4*a*c))/(2*a)
R2=(-b-sqrt(b^2-4*a*c))/(2*a)
end
ingrese a: 1
ingrese b: 0
ingrese c: 1
R1 =
0 + 1.0000i
R2 =
0 - 1.0000i
>>
E.-
x=[0 0 0];
sort(x)
if (x(3)-x(1))<x(2)& x(2)<(x(3)+x(1))
if (x(3))^2==(x(1))^2+(x(2))^2
elseif (x(3))^2>(x(1))^2+(x(2))^2
elseif (x(3))^2<(x(1))^2+(x(2))^2
end
end
CLASIFICACION DE TRIANGULOS
ans =
9 10 11
el angulo es agudo
>>
F.-
fprintf(' x<=0,y=x.^2+1;\n');
x=-5:pi/200:0;y=x.^2+1;plot(x,y,'k');
hold on;
x=0:pi/200:3;y=x.^2+3*x+2;plot(x,y,'m');
fprintf(' x>=3,y=x+1;\n');
x=3:pi/200:8;y=x+1; plot(x,y,'r');
grid on
axis equal
GAFICA DE LA FUNCION
x<=0,y=x.^2+1;
x>=3,y=x+1;
>>
G.-
a=input('ingrese a: ')
b=input('ingrese b: ')
if a^2-b^2<0
disp('f(x)'); 2*a+b
elseif a^2-b^2==0
disp('f(x)'); a^2-2*b
else
disp('f(x)'); a+b
end
FUNCION
ingrese a: 23
a=
23
ingrese b: 8
b=
f(x)
ans =
31
>>
H.-
>> fprintf(' EL VALOR INTERMEDIO ES \n');
x=[0 0 0]
r=sort(x),
EL VALOR INTERMEDIO ES
x=
0 0 0
r=
5 23 88
r=
5 23 88
el numero 23.000000 es el intermedio
>>
J.-
p=(20*a+40*b+40*c)/100
end
p=
13.6000
el alumno es REGULAR
>>