MATLAB Answers

I need MATLAB to read my data from the bottom up.

4 views (last 30 days)
Shakib Ishfaq
Shakib Ishfaq on 27 May 2019
Answered: Raghunandan V on 28 May 2019
I'm calculating portfolio returns from daily prices. As you can see from the attached file, my dates are organised such that latest date and price are listed first and then scrolling down the column, dates become older. So to calculate returns, I need MATLAB to read my data in inverse, from the bottom up.
I am calculating returns using the functions found on this page
however, this only allows me to return results for a single asset in my portfolio. I require returns for multiple product prices in my portfolio.
Any help deeply appreciated. Thank you.


Sign in to comment.

Answers (1)

Raghunandan V
Raghunandan V on 28 May 2019
I can help you with first part of the question. To read it inverse
%get the length
[m n] = size(TXT)
for k=1: m
%to read from last
q = m-k+1
read = RAW(q)
I don't know about price series data. I think you have post another question for the second part with different tags to get the answer.


Sign in to comment.




Community Treasure Hunt

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

Start Hunting!

Translated by