Multiply and group values dependent on condition
이전 댓글 표시
The final step of my analysis is to multiply the returns and the expected returns for each earnings date.
The output should be something like this:
Ticker: EarningsDate: Returns: Expected Returns:
APPL 31-Jan-2017 (-0.0026*-0.0023*-0.0610) (-0.0064*-0.0016*0.0032)
APPL 02-May-2017 etc etc.

Can anybody give me some hint how to achieve this?
댓글 수: 1
Walter Roberson
2022년 11월 11일
You flagged the question as inappropriate for MATLAB Answers. Could you expand on why you now believe that your question is not a valid question about MATLAB ?
답변 (1개)
Image Analyst
2022년 11월 2일
편집: Image Analyst
2022년 11월 2일
If t is your table, did you try
out = t.Return .* t.ExpectedReturn % Multiply columns together
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
댓글 수: 3
MT_22
2022년 11월 2일
Image Analyst
2022년 11월 3일
OK, fine, but I can't run an image. I need code and data. It looks like you overlooked part of my response, so again:
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Image Analyst
2022년 11월 3일
Sorry, heading out for the day but this works
T = readtable("data_question.txt")
out = T.Return .* T.ExpectedReturn % Multiply columns together
then just use the other functions I told you.
카테고리
도움말 센터 및 File Exchange에서 Financial Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!