Best shap for data to be in to work on.

1 Ansicht (letzte 30 Tage)
Scragmore
Scragmore am 22 Nov. 2011
Hi,
I have a number of years of time series data of the format;
Date Time Open High Low Close
734141 1544 1.6152 1.6152 1.6152 1.6152
734141 1545 1.6152 1.6153 1.6151 1.6152
734141 1546 1.6152 1.6152 1.6152 1.6152
This is stored in an Access DB that I am able to import change dates, times, manipulate the data ect..
I would like to do analysis on data per day, such as Max(time_a, time_b), HighLow(t_a, t_b), price_direction(after_t_c), MovAv, interval_diff.
What I am having trouble with is the shape of my initial stored data in matlab. Should I store it as a single array of time series data, a double array or would a struc for each day be better. I eventually would like to run my complete data set of day data through functions I build, testing my models and ideas, creating flags when criteria are met.
I know this is a slightly unusual question as you all usually deal with code/math issues that can be solved by debugging or writing/suggesting code. If your unable to help would some one be able to point me in the direction of a matlab forum/group that might be able to advise. I am unemployed and not in a class or college so I don't have colleagues or profs to ask or discuss with.
Many thanks.
AD

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 22 Nov. 2011
It looks to be a good use case for dataset(). See doc dataset.
  3 Kommentare
Fangjun Jiang
Fangjun Jiang am 23 Nov. 2011
I regard dataset() as an enhancement of structure. I have not used it very often so I have to learn it myself too. I believe it can be done. The nice part of it is that you can use those header text such as 'time','open','close' to reference your data thus make it much more readable.
You can use regular 2-D array to achieve the same if it's more comfortable or easier for you. You probably just need to use logical index for most of your query. For example.
index=data(:,1)==734141;
SelectedData=data(index,:);
This way, you just need to remember which column is Date, which column is Time, etc.
Scragmore
Scragmore am 24 Nov. 2011
Hi,
Thanks for your time and suggesting this. Unfortunately I am still unable to work out how to query the dataset.
I shall continue to look for some help on how I should construct my data.
Thanks and regards,
AD

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Holidays / Seasons finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by