Index Exceed Marix Dimensions
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Hello, I am trying to repopulate an input dialog box with answers the user previously put in. I am saving the file correctly but when I try and load the answers I am getting the error index exceed matrix dimensions. I think that it is a +1 or -1 error, can someone look at the code and help with debugging and give an explanation for this problem, thank you.
PrefFile = fullfile(prefdir, 'MyGUI.pref');
if exist(PrefFile, 'file')
FileData = load(PrefFile, '-MAT');
cell_FileData = struct2cell(FileData);
for i=1:NumQuest;
set(EditHandle(i),'String', cell_FileData{1,i});
NumQuest - 1;
end
end
댓글 수: 1
Matt J
2013년 7월 12일
Timothy Commented:
So my problem is in cell_FileData it is a 1 x X cell I don't think that it is stepping forward with the rest of the program is there a way to fix it?
답변 (2개)
Either cell_FileData is shorter than NumQuest or EditHandle is.
댓글 수: 1
cell_FileData it is a 1 x X cell I don't think that it is stepping forward with the rest of the program
If X<NumQuest there is nowhere for it to step forward. Are you sure your loop is supposed to run from 1 to NumQuest, or is it in fact supposed to go from 1 to X?
이 질문은 마감되었습니다.
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!