i am trying to get emg and force data simultaneously using parallel computing tool box but i am unable to read the data???
Ältere Kommentare anzeigen
i am using the below code
if matlabpool('size') == 0
matlabpool open local 2
data1=zeros([122880,2]);
data2=zeros([37000,1]);
spmd
switch labindex
case 1
s = daq.createSession('ni');
s.addAnalogInputChannel('cDAQ2Mod1', 0, 'Voltage');
s.addAnalogInputChannel('cDAQ2Mod1', 1, 'Voltage');
s.Rate = 2048
s.DurationInSeconds = 60;
labBarrier
[data1,time] = s.startForeground;
case 2
delete(instrfindall);
s = serial ( 'COM5', 'BaudRate', 115200);
set(s, 'Timeout',60);
s.InputBufferSize =37000;
labBarrier
fopen(s);
data2=fread(s);
end
end
end
matlabpool close
my workspace is containing data in composite form
is there any way to solve this problem???
5 Kommentare
avinash pabbireddy
am 1 Dez. 2013
Edric Ellis
am 2 Dez. 2013
What is the problem? You can access the elements of data1 and data2 using indexing, like so
>> data1{1} % get a single element
>> data2(:) % get all elements as a cell array
avinash pabbireddy
am 2 Dez. 2013
avinash pabbireddy
am 2 Dez. 2013
avinash pabbireddy
am 2 Dez. 2013
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Import and Export finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!