Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How can I match my subscripted assignment dimensions?

1 Ansicht (letzte 30 Tage)
Matthew
Matthew am 7 Jul. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by