Академический Документы
Профессиональный Документы
Культура Документы
syms A B C C1 F F1 S K
%Instruccion de asignacin
A=[3.5,2.1];
B=[1.5,3.1];
C=[-1,0,0;1,1,0;1,-1,0;0,0,2];
C1=[-1,0,0
1,1,0
1,-1,0
0,0,2];
x=C(:,1);
y=C(:,2);
z=C(:,3);
x1=C(1,:);
y1=C(2,:);
z1=C(3,:);
h=1:8;
h1=0:0.5:7;
c_partial_1=C(:,1:3);
c_partial_2=C(3:4,1:2);
%ENTRADA DE DATOS
% t= input('Introduzca valores para t en corchetes: ');
%OPCIONES DE SALIDA
%Formatos de exhibicion de numeros
%format short por omision 15.2345
%format long 14 decimales 15.23453333333333
%format bank 2 decimales 15.23
%format short e 4 decimales 1.5235e+01
%format long e 15 decimales 1.523453333333333 e+01
%GRAFICAS xy SENCILLAS
V1=1:10;
V2=[58.5;63.8;64.2;67.3;71.5;88.3;90.1;90.6;89.5;90.4];
%Grafica y ESTILOS
plot(V1,V2),title('Experimento de laboratorio'),...
xlabel('Ensayo'),ylabel('Distancia, ft'),grid
P1=1:5;
P2=1:2:9;
PRACTICE 2
clc
syms A B C C1 F F1 S K
%Funciones Matematicas
alfa=60*pi/180;
b=sin(alfa);
c=cos(alfa);
%Funciones matematicas comunes
% abs(x)
% sqrt(x)
% round(x) Redondea x al entero mas cercano
% fix(x) Redondeo x al entero mas cercano a 0
% floor(x) Piso - infinito (entero mas cercano)
% ceil(x) Techo + infinito (entero mas cercano)
% sign(x) Devuelve -1 si x<0, un valor de 0 si x=0, devuelve 1 si x>0
% rem(x,y) Devuelve el residuo x/y rem(25,4) es 1 rem(100,21) es 16
% exp(x) e^x
% log(x) Log natural
% log10(x) Log base 10
x1=2.2;
log_x=log10(abs(x1));
%Funciones Trigonometricas
% x , angulo debe estar en radianes
% sin(x)
% cos(x)
% tan(x)
% asin(x)
% acos(x)
% atan(x)
% sinh(x)
% cosh(x)
% tanh(x)
%Funciones de NUMEROS COMPLEJOS
%Notacion Correcta x = a + ni*b
y= 1-2i*0.5;
t=angle(y);
theta=0:2*pi/100:2*pi;
r=theta/2*pi;
polar(theta,r), title('Grafica Polar')
%FUNCIONES DE 2 VARIABLES
x1=0:0.1:5;
f=2*x1.^2-3*x1+2;
x3=-2:0.1:2;
y3=-1:0.1:2;
clc
syms A B C C1 F F1 S K
% b=[0,0,4;
% 1,2,0;
% 8,0,0];
% x=-3:0.1:3;
% y=rect(x);
% plot(x,y),title('Funcion Rect'),...
% xlabel('x'),ylabel('y')
%Ejemplo 6.1
% clear, clc
% % Definir un vector
% degrees=0:15:180;
% %Llame la funcion DR
% radians=DR(degrees);
% %Crea una tabla para usar en la salida
% degrees_radians=[degrees;radians]';
% clear,clc
% N=1:100; %N: Numero de granos
% n=grain_size( N ); %n: Tamao de los granos
% plot(N,n),title('Grafico'), xlabel('Numero de granos'),ylabel('Tamao
de grano'),grid
% %BUCLE WHILE
% scores=[76,45,98,97,99];
% count=0;
% k=0;
% while k<5
% k=k+1;
% if scores(k)>90
% count=count+1;
% end
% end
%
% disp(count)
% k=1;
% while k<=36
% degree(k)=k*10;
% radians(k)=degree(k)*pi/180;
% k=k+1;
% end
% table=[degree;radians]';
k=1;
for k=1:36
degree(k)=k*10;
radians(k)=degree(k)*pi/180;
k=k+1;
end
table=[degree;radians]';
disp(table)