Problems extracting column array from historical stock price data

조회 수: 8 (최근 30일)
asher leask
asher leask 2020년 5월 19일
댓글: Sindar 2020년 5월 19일
I'm tring to extract the dates from historical stock price data for Amazon.
My understanding is
a = importdata('AMZN.csv');
date = a.data(end:-1:1,1)
should do the trick, however, it extracts column 2 instead.
This is also true if I insert extra columns at the start of the csv file. I added a copy of the last column into the first column, and running the same code as above now extracts column 3 - the same column as in my first attempt.
What am I doing wrong?
https://finance.yahoo.com/quote/AMZN/history/ (the link if someone wants to try for themselves)
  댓글 수: 1
Sindar
Sindar 2020년 5월 19일
try readtable instead
But, if you're set on (or stuck with) importdata, try looking at a and a.data directly and see if you can figure out what's going wrong

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by