Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How can I match my subscripted assignment dimensions?

1 visualización (últimos 30 días)
Matthew
Matthew el 7 de Jul. de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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

Respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by