Info

This question is closed. Reopen it to edit or answer.

How to sort table entries into cell array for neural network. --SOLVED/CLOSED--

1 view (last 30 days)
I have data from a different set of sensors ordered in a table. The first column is the timestamp, and the other 2 columns are similar numerical values (integers).
NOTE: I'M USING NEURAL NETWORK TOOLBOX
I'm trying to feed my data through layrecnet so before this I want to be safe and sending the data through preparets. Unfortunately I'm having a ridiculous hard time trying to format the data in the right way, I'm getting it to work with data from one column ( oneSensorInput = table2cell(allData(:, 2)) ), but I can't, for the love of god, get it to work for columns 2:4.
Now it looks like:
if true
Columns 1 through 5
[-11] [-9] [11] [12] [-2]
end
I think I want it to look like:
if true
Columns 1 through 5
[-11 4 5] [-9 1 6] [3 11 4] [7 12 43] [-14 -2 45]
end
But I'm not sure, can't find info in the help
Thanx in advance, M
  2 Comments
Mal
Mal on 28 Sep 2017
Don't know :) with the example in the help docs they input a 1×100 cell array. I'm thinking a 3×100 cell array would do the trick for me, but maybe I'm wrong. And I can't get it right anyways..

Answers (1)

Greg Heath
Greg Heath on 28 Sep 2017
1. You say you have 1 timestamp column and 2 other columns. HOWEVER
a. later you mention columns 2:4
b. The VARIABLES in MATLAB timeseries are ROWS OF CELLS
c. Each SAMPLE in a timeseries is a COLUMN OF CELLS
d. Each cell row may contain MULTIPLE rows of double variables
e. Example
sizeX = size(X) % [ 2 100 ]
x = cell2mat(X);
sizex = size(x) % [ 6 100 ]
2. Why are you using LAYRECNET instead of the basic feedback net NARXNET?
3. Regardless of which timeseries function you use, it is worthwhile to FIRST solve the examples in both the HELP and DOC documentation (however, most of the time they are the same example!).
help narxnet
doc narxnet
4. It is worthwhile to search BOTH the NEWSREADER and ANSWERS for previous posts regarding whichever function you choose.
Hope this helps.
*Thank you for formally accepting my answer*
Greg
  2 Comments
Mal
Mal on 28 Sep 2017
Your answer didn't really help me this time. Solved it differently. Thanks anyways for your time and effort!

This question is closed.

Community Treasure Hunt

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

Start Hunting!