Assignment error in double loops
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Oday Shahadh
el 6 de Feb. de 2017
Comentada: KSSV
el 6 de Feb. de 2017
I tried this
long=linspace(0,360,288);
lat=linspace(0,180,180);
res=zeros(length(lat),long(lat));
for i=1:length(long)
for j=1:180
res=[long(i) lat(j)];
end
end
and got this error
Subscript indices must either be real positive integers or logicals.
| Error in odayalbedo (line 9) res=zeros(length(lat),long(lat));|
0 comentarios
Respuesta aceptada
KSSV
el 6 de Feb. de 2017
Change
res=zeros(length(lat),long(lat));
to
res=zeros(length(lat),length(lat));
5 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Multidimensional Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!