Matlab - Generar integral (Area Bajo la cuerva teniendo como origen un txt)

 
Vista:
sin imagen de perfil

Generar integral (Area Bajo la cuerva teniendo como origen un txt)

Publicado por Addison (15 intervenciones) el 21/11/2017 21:34:12
Necesito ayuda para poder generar la integral de dos señales, los datos estan en un archivo txt, el sistema abre el archivo pero necesito integrar estas señales, en el txt adjunto, aparencen 2 columnas y estan separadas por coma

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
linea = fgetl(id); % lee toda la línea
fclose(id); % cierra el archivo leído
linea;
    a=importdata([ruta, archivo]);
    A=a.data;
    for i=1:size(A,2);
        subplot(4,1,1);
        plot (A(:,1),'color', rand(1,3));
        title(linea,'fontsize',18, 'FontWeight','bold','Color','b');
        axis([0 inf 190 inf]);
        subplot(4,1,2);
        plot (A(:,2))
        axis([0 inf 190 inf])
    end
    RMS1=rms(A(:,1))
    RMS2=rms(A(:,2))
    Z1 = cumtrapz(A(:,1))
    Z2 = cumtrapz(A(:,2))
    subplot(4,1,3);
    plot (A(:,1))
    axis([0 inf 190 inf])
    subplot(4,1,4);
    plot (A(:,2))
    axis([0 inf 190 inf])
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de JOSE JEREMIAS CABALLERO
Val: 6.975
Oro
Ha mantenido su posición en Matlab (en relación al último mes)
Gráfica de Matlab

Generar integral (Area Bajo la cuerva teniendo como origen un txt)

Publicado por JOSE JEREMIAS CABALLERO (5917 intervenciones) el 22/11/2017 13:30:22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
clear all
id=fopen('2 columnas.txt');
linea = fgetl(id); % lee toda la línea
fclose(id); % cierra el archivo leído
archivo='2 columnas.txt';
    a=importdata(archivo);
    A=a.data;
    for i=1:size(A,2);
        subplot(4,1,1);
        plot (A(:,1),'color', rand(1,3));
        title(linea,'fontsize',18, 'FontWeight','bold','Color','b');
        axis([0 inf 190 inf]);
        subplot(4,1,2);
        plot (A(:,2))
        axis([0 inf 190 inf])
    end
    RMS1=rms(A(:,1))
    RMS2=rms(A(:,2))
    Z1 = cumtrapz(A(:,1))
    Z2 = cumtrapz(A(:,2))
    subplot(4,1,3);
    plot (A(:,1))
    axis([0 inf 190 inf])
    subplot(4,1,4);
    plot (A(:,2))
    axis([0 inf 190 inf])

Saludos
JOSE JEREMIAS CABALLERO
Asesor de Proyectos con Matlab
Servicios de programación matlab


http://matlabcaballero.blogspot.com
https://www.facebook.com/matlabcaballero
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar