Index exceeds matrix dimensions
조회 수: 1 (최근 30일)
이전 댓글 표시
Please find below my code:
readdata=get(handles.uitable2,'data');
readdata=cellfun(@num2str, readdata, 'UniformOutput', false);
[nr,nb]=size(readdata);
for k=1:nr
disp(k)
disp(readdata(k,7))
if strcmp(readdata(k,7),'1')==1
readdata(k,:)='';
range=strcat('J',num2str(indexvec(k)+1));
xlswrite('cylinders record.xls','1','Record',range)
if strcmp(readdata(k,8),'1')==1
range=strcat('K',num2str(indexvec(k)+1));
xlswrite('cylinders record.xls','1','Record',range)
end
end
end
set(handles.uitable2,'data',readdata)
the problem is that i'm getting an error msg that the index exceeds the matrix even though i am making the loop knowing the size of the matrix!!!!
please note that the 7th and 8th column of readdata are of logical format (checkboxes)!!
i would like to add that when no checkbox is checked i don't face this problem, it only occur when a checkbox is checked
댓글 수: 5
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!