我試圖運行下面的代碼通過在一個循環的整數:如何使用MATLAB
%% Getting Stocks
stocks = hist_stock_data('01012013','07112014','GDXJ', 'SPY','GOOGL', 'QQQ', 'AAPL');
%% Loop to get the stocks in order by date
while i <= 5
stocks(1,i).Date=datenum(stocks(1,i).Date);
stocks(1,i).Date = stocks(1,i).Date(end:-1:1);
stocks(1,i).AdjClose = stocks(1,i).AdjClose(end:-1:1);
stocks(1,i).Ticker =stocks(1,i).AdjClose;
end
但是我收到以下錯誤:
Subscript indices must either be real positive integers or logicals.
我已經在網上搜索但不明白爲什麼我得到這個錯誤?
感謝,真正幫助! – Rime 2014-11-08 08:02:38