How can I change a cell array with timepoints in to a continous binary matrix? (for Neural Network Toolbox)
(XX{1,1}) = {[ 3.4078]} {[ 3.7273]} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {[ 3.4684]} {0×0 double} ...
Error using trainNetwork (line 140) Invalid training data. Predictors must be a cell array of sequences. The data dimension of all sequences must be the same. Caused by: Error using nnet.internal.cnn.util.TrainNetworkDataValidator/assertValidSequenceInput (line 269) Invalid training data. Predictors must be a cell array of sequences. The data dimension of all sequences must be the same.
In order to use this as an input for a LSTM-Network in the Neural Network Toolbox these timepoints needs to be part of a continous spectrum. My idea was to convert this discrete datapoints in to large binary matrix (50x10000) inwhich the columns represent the time, therefore 10 seconds = 10000 columns. At each timepoint a spike occured (e.g. 3.4078) a 1 should be put for the corresponding neuron. I tried indexing the cell array with a time-vector ( t = (0:0.001:10) ) but it didn't work. Can anyone help transforming the data? Thank you.
% XX = original cell array seqNum = 15; neuronNum = 50; % create new cell array XX2 = cell([seqNum 1]); for i = 1:seqNum XX2{i} = zeros(neuronNum, 10000); currSeq = XX{i}; for j = 1:neuronNum % convert times into indices a = round(currSeq{j,1}*10000); b = round(currSeq{j,2}*10000); % Index into array of zeros XX2{i}(j, [a b]) = 1; end end
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.