Professional Documents
Culture Documents
PROGRAMAS MATLAB
INTEGRANTES:
JOHNN PUCA
ROBERTO PUJOS
CHRISTIAN HUANCA
n=1:0.5:10;
zn=((1i.^n)+1);
Gráfica
2. Graficar la serie (i^n+1/n)
end
ints=2;
while (ints>=0)
z2=input('Ingrese los valores de z2= ','s');
[zy,tf] = str2num(z2);
if (tf==0)
disp('ingresa números complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
suma=zx+zy;
fprintf('La suma es: ')
disp(suma)
case 2
ints=2;
while (ints>=0)
z1=input('Ingrese los valores de z1= ','s');
[zx,tf] = str2num(z1);
if (tf==0)
disp('ingresa números complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
ints=2;
while (ints>=0)
z2=input('Ingrese los valores de z2= ','s');
[zy,tf] = str2num(z2);
if (tf==0)
disp('ingresa números complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
prod=zx*zy;
fprintf('EL producto es: ')
disp(prod)
case 3
ints=2;
while (ints>=0)
m=input('Ingrese el indice de potencia','s');
[zx,tf] = str2num(m);
if (tf==0)
disp('Ingresa un indice entero positivo')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
ints=2;
while (ints>=0)
z1=input('Ingrese los valores de z1= ','s');
[zy,tf] = str2num(z1);
if (tf==0)
disp('ingresa números complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
poten=zy^zx;
fprintf('la potencia es: ')
disp(poten)
case 4
ints=2;
while (ints>=0)
m=input('Ingrese el indice de la raiz','s');
[zx,tf] = str2num(m);
if (tf==0)
disp('Ingresa un indice entero positivo')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
ints=2;
while (ints>=0)
z1=input('Ingrese los valores de z1= ','s');
[zy,tf] = str2num(z1);
if (tf==0)
disp('ingresa números complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
rai=zy^(1/zx);
fprintf('la raiz es: ')
disp(rai)
case 5
ints=2;
while (ints>=0)
z1=input('Ingrese los valores de z1= ','s');
[zx,tf] = str2num(z1);
if (tf==0)
disp('ingresa números complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
conju=conj(zx);
fprintf('la conjugada de z1 es ')
disp(conju)
case 6
ints=2;
while (ints>=0)
z1=input('Ingrese los valores de z1= ','s');
[zx,tf] = str2num(z1);
if (tf==0)
disp('Ingresa número complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
ln=log(zx);
fprintf('El logaritmo de z1 es: ')
disp(ln)
case 7
ints=2;
while (ints>=0)
z1=input('Ingrese los valores de z1= ','s');
[zx,tf] = str2num(z1);
if (tf==0)
disp('Ingresa número complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
norma=abs(zx);
fprintf('la norma de z1 es: ')
disp(norma)
case 8
ints=2;
while (ints>=0)
z1=input('Ingrese los valores de z1= ','s');
[zx,tf] = str2num(z1);
if (tf==0)
disp('Ingresa número complejos')
cont=['Tienes ', num2str(ints), ' intentos'];
disp(cont)
ints= ints-1;
if (ints==-1)
return
end
else
ints=-1;
end
end
ang=(angle(zx)*180)/pi;
fprintf('El ángulo de z1 es: ')
disp(ang)
case 9
return
otherwise
error('Seleccione un número del menú')
end
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = fig1_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
while(p ~= 2)
fprintf('\tMenú:\n 1.- Calcular\n 2.- Salir\n')
op=input('Seleccione una opción: ','s');
if((op>47 & op<58) & op~=105 & op~=106)
p=str2double(op);
end
switch p
case 1
z=input('Ingrese la curva C parametrizada z(t)=x(t)+jy(t):
');
disp(z)
dzt=diff(z,t);
fprintf('La diferencial de la curva es:\n');
disp(dzt)
fz1=fzt*dzt;
sol=int(fz1,t,li,ls);
fprintf('El resultado de la integral es:\n');
disp(sol);
pause;
case 2
fprintf('\n\tFIN DEL PROGRAMA\n\n');
otherwise
fprintf('\tOPCIÓN INCORRECTA\n\n');
end
end
6. Grafica de una función exponencial