Best shap for data to be in to work on.
4 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Fangjun Jiang
2011-11-22
It looks to be a good use case for dataset(). See doc dataset.
3 个评论
Fangjun Jiang
2011-11-23
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!