Hi all,
I have a EEG .mat file which contains 16 channels of monopolar signals, I would like to know how i can plot it out to display all 16 channels. I tried plotting via the value that appear on workspace but it gave me a graph with all 16 channels mash together.

7 Kommentare

Azzi Abdelmalek
Azzi Abdelmalek am 28 Okt. 2012
can you post a sample of your data
Ken
Ken am 28 Okt. 2012
Azzi Abdelmalek
Azzi Abdelmalek am 28 Okt. 2012
Ken, do you want to plot them in the same figure? it's not a good idea,
Ken
Ken am 28 Okt. 2012
Ya, i need to have the 16 channels in one graph. Why is it not a good idea?
Azzi Abdelmalek
Azzi Abdelmalek am 28 Okt. 2012
Ok, depends on what you want
javier coronado  bautista
javier coronado bautista am 24 Feb. 2016
bueno ahí les dejo el código de adquisición de datos en tiempo real con el NI USB 6210 en matlab 2015b
javier coronado  bautista
javier coronado bautista am 24 Feb. 2016
%d=daq.getDevices%obtenemos las caracteristicas del NI USB 6210 %d(1) %samplingRate=2000; %numberofSamples=200;%nuemero de muestras
s.Rate = 200;% frecuencia de muestreo=Fs %ai = s.inputSingleScan() %leemos las entradas de los canales analogicas a NI USB 6210 %m= fopen('event.Data','w'); %excelFileName= 'samplemalaga'; s.DurationInSeconds = 40;%definimos el tiempo de la adquisicion ch=s.addAnalogInputChannel('coronado','ai0', 'Voltage');% ch.Range=[-5 5]; ch.Name='CANAL C0' ch.InputType='SingleEnded';%Ajustar en modo referenciado a masa (RSE) s.NumberOfScans %Numero de exploraciones para la operacion cuando se inicia sesion ch=s.addAnalogInputChannel('coronado','ai1', 'Voltage'); ch.Range=[-5 5]; ch.Name='CANAL C1' ch.InputType='SingleEnded';%Ajustar en modo referenciado a masa (RSE) ch=s.addAnalogInputChannel('coronado','ai2', 'Voltage'); ch.Range=[-5 5]; ch.Name='CANAL C2' ch.InputType='SingleEnded';%Ajustar en modo referenciado a masa (RSE) ch=s.addAnalogInputChannel('coronado','ai3', 'Voltage'); ch.Range=[-5 5]; ch.Name='CANAL C3' ch.InputType='SingleEnded';%Ajustar en modo referenciado a masa (RSE) %s.NumberOfScans %Numero de exploraciones para la operacion cuando se inicia sesion %s.addAnalogInputChannel('coronnel('coronado','ai7', 'Voltage'); %s.addAnalogInputChannel('coronado','ai8', 'Voltage'); %s.addAnalogInputChannel('coronado','ai9', 'Voltage') %s.NumberOfScans = 2000 %Número de exploraciones para la operación cuando se inicia [data,timestamps,triggerTime] = s.startForeground();% startForeground %devuelve los datos de varias exploraciones adquiridos en una matriz mxn, donde m nuemero de exploracionesy nu numero de canales %ai = s.inputSingleScan() %leemos solo una exploracion de todos los 4 canales "C0,C1,C2,C3" de toda las exploraciones %Para adquirir varias exploraciones mediante operaciones temporizadas , véase % startForeground %d=daq.getDevices%obtenemos las caracteristicas del NI USB 6210 %d(1) %set(ai,'triggerFcn',{@mycalback,nado','ai4', 'Voltage'); %s.addAnalogInputChannel('coronado','ai5', 'Voltage'); %s.addAnalogInputChannel('coronado','ai6', 'Voltage'); %s.addAnalogInputCha %obj2mfile(ai,'myai.m'); %created:d\v6\myfiles\myai.m %created:d\v6\myfiles\myai.mat %m= fopen('event.Data','w'); %ch.InputType='SingleEnded'%Ajustar en modo referencia a masa| %Añadir un oyente con una llamada a la función anónima %lh = s.addlistener('DataAvailable', @getData);
lh = s.addlistener('DataAvailable',... @(src,event) plot(event.TimeStamps, event.Data));% creamos un oyente
%Adquirir datos s.NotifyWhenDataAvailableExceeds = 200;% frecuencia con la que el evento DataAvaialble se dispara s.startBackground();% la adquision de datos se realiza en el fondo s.IsLogging % ans = true ;esta adquiriendo datos,false=no adquiere dato %s.ScansAcquired %pause(5); s.wait() % m= fopen('event.Data','w'); %s.IsContinuous = true;% signal analog %s.startBackground() %data = getdata(ai); % comienza %s.stop; delete(lh); %fclose(m); % n = fopen('event.Data','r'); %[data,count] = fread(n,[3,inf],'double');
s.IsNotifyWhenDataAvailableExceedsAuto = true; lh = s.addlistener('DataAvailable', @stopWhenExceedOneV);%configurar nuevo oyente para procesar los datos entrantes type('stopWhenExceedOneV.m') %lh=s.addlistener('DataAvailable',... % @(getData) getData(src,event) );
%filename='event.Data' %save(filename) s.IsContinuous = true; %signal digital s.startBackground() %s.ScansAcquired%Número de exploraciones obtenida durante la operación %while s.IsRunning %pause(0.01) %fprintf('While loop: Scans acquired = %d\n', s.ScansAcquired) %end fprintf('Acquisition has terminated with %d scans acquired\n', s.ScansAcquired); disp('Acquiring data...'); disp('Acquisition complete.'); title('BRAIN UNFV-FIEI-PERÚ','color','red') % n = fopen('event.Data','r'); %[data,count] = fread(n,[3,inf],'double') xlabel('Time (segundos)'); ylabel('Voltage') Stop = 1; uicontrol('style','pushbutton','String','start',... 'Callback','Stop = 0;'); delete(lh)
%axis([0 40 -5 5 ]) toc% empleamos tic-toc para calcular el timpo de adquision
%mkdir('SESIONES/prueba'); %addpath ( 'SESIONES /prueba / myfiles' ) %prueba= 'test.mat'; %save(prueba)
%[stat,struc] = fileattrib; %PathCurrent = struc.Name; % guardar figura en la carpeta
% guardar workspace en la carpeta
%set(ai,'SampleRate',SampleRate); %set(ai,'SamplesPerTrigger',duration*SampleRate); %set(ai,'TriggerType','Manual'); %s.Rate = 8000; %s.DurationInSeconds = 1; %[ai,triggerTime] = s.startForeground(); %plot(triggerTime,ai); % Update the title of the graph %set(titleHandle,'String',['Discrete Fourier Transform Plot (fft),Number of callback function calls: ', num2str(count)]);
%%rtwintgt -install %rtwintgt -uninstall %rtwintgt -version %rtwho
%rtwintgt -setup installs the Real-Time Windows Target kernel on your system. It performs the same operation as rtwintgt -install.
%rtwintgt -install installs the Real-Time Windows Target kernel on your system. It performs the same operation as rtwintgt -setup. On Windows Vista™ and Windows® 7 systems, rtwintgt -install requires User Account Control (UAC) to be enabled.
%rtwintgt -uninstall removes the Real-Time Windows Target kernel from your system. On Windows Vista and Windows 7 systems, rtwintgt -uninstall requires User Account Control (UAC) to be enabled.
%rtwintgt -version displays the Real-Time Windows Target currently installed on your system

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 28 Okt. 2012

0 Stimmen

data=load ('sub1_export');
t=data.EEG_SAMPLE.time;
y=data.EEG_SAMPLE.signals.values;
out=reshape(y,16,[],1)
plot(t,out)

7 Kommentare

Ken
Ken am 28 Okt. 2012
Azzi thanks for the code, the Out data is what i wanted. But is there a way to destack it so that the the y axis show 16 channels and the x axis is all the data?
Azzi Abdelmalek
Azzi Abdelmalek am 28 Okt. 2012
Bearbeitet: Azzi Abdelmalek am 28 Okt. 2012
what do you mean by destack?
Ken
Ken am 28 Okt. 2012
out=reshape(y,16,[],1) The data that have been reshape to 16 x 62397. How can u plot it so that the y axis show 16 channels that are not stack together but separated and the x axis is all the data?
Azzi Abdelmalek
Azzi Abdelmalek am 28 Okt. 2012
Bearbeitet: Azzi Abdelmalek am 28 Okt. 2012
they can't be separated if they are in the same figure, that what I told you before! the x axis is the time. If you want them separated use subplot
for k=1:16
subplot(4,4,k),plot(t,out(k,:))
end
Ken
Ken am 28 Okt. 2012
icic, thanks a lot Azzi
Sarvesh Babu
Sarvesh Babu am 16 Feb. 2018
Azzi what is t? Sorry to disturb you.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by