Info

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

Index Exceed Marix Dimensions

1 visualización (últimos 30 días)
Timothy
Timothy el 12 de Jul. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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 comentario
Matt J
Matt J el 12 de Jul. de 2013
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?

Respuestas (2)

Matt J
Matt J el 12 de Jul. de 2013
Editada: Matt J el 12 de Jul. de 2013
Either cell_FileData is shorter than NumQuest or EditHandle is.
  1 comentario
Matt J
Matt J el 12 de Jul. de 2013
Editada: Matt J el 12 de Jul. de 2013
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?

Timothy
Timothy el 12 de Jul. de 2013
Editada: Matt J el 12 de Jul. de 2013
Relocated to Comment by Matt J

La pregunta está cerrada.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by