Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: what to use when reshape is not good anymore?please some help
Replies: 2   Last Post: Sep 8, 2013 6:15 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Marinela Finta

Posts: 4
Registered: 8/20/13
what to use when reshape is not good anymore?please some help
Posted: Sep 6, 2013 1:52 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I am just starting to learn matlab and I would appreciate very much if you could help me...

I am stuck with calculating the returns between some hours and for each day..
For some date was going ok the following method:
(now the price is between that hours)
n=length(price);
% The number if days
%(79 is the number of observations within one day)
ndays = n/79;
price_d = reshape(price,79,ndays);
%I take returns for each day
returns_d = log(price_d(2:79,:))- log(price_d(1:78,:));

However now I have another data where the number of observations are not anymore the same for each day..So in one day I have 79 in another 30,75 observations within a day.Therfore i CANNOT use anymore RESHAPE..:(

How should I do in order to have sorted the observations(prices) according to each day? So to have similar thing as before: row with the prices and column with prices corresponding to each day..
thank you for your time..
Marinela




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.