Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I match my subscripted assignment dimensions?

1 回表示 (過去 30 日間)
Matthew
Matthew 2014 年 7 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I'm trying to retrieve multiple securities from Yahoo! by using a loop then storing the results in a matrix. However, I keep encountering the error, "Subscripted assignment dimension mismatch." How can I fix this?
Here is my script:
c = yahoo;
ticker = {'GOOG' 'IBM' 'TWTR'};
fromdate = { 735766, 735767, 735783};
todate = { 735783,735783,735783};
for i = 1:3
Price.(ticker{i}) = fetch (c,ticker(i),'Adj Close',fromdate{i},todate{i});
temp = Price.(ticker{i});
ClosePrice(:,i) = temp (:,2);
end
EDU>> extwo
Subscripted assignment dimension mismatch.
Error in extwo (line 10)
ClosePrice(:,i) = temp (:,2);
Any help would be great! Thanks,
Matt

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by