Assignment error in double loops
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
KSSV
2017년 2월 6일
Change
res=zeros(length(lat),long(lat));
to
res=zeros(length(lat),length(lat));
댓글 수: 5
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!