Index in position 2 exceeds array bounds (must not exceed 1)

Hi everyone, I have this error: Index in position 2 exceeds array bounds (must not exceed 1).
Error in GUI_Current > apply_x_y_axis_data_Callback (line 651) combo_VAR_unique = unique(ComboValue(:,V));
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in GUI_Current (line 20) gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)GUI_Current('apply_x_y_axis_data_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating DestroyedObject Callback.
I dont know how can I fox this error?

 Akzeptierte Antwort

Jan
Jan am 11 Jul. 2018
Bearbeitet: Jan am 11 Jul. 2018

0 Stimmen

The message means, that you try to access ComboValue(:,V) with V > 1, but size(ComboValue, 2) is 1 only.
Without seeing the code it is impossible to guess how the code can be modified to work as wanted.

4 Kommentare

Thanks for your answer. The overview of code is :
for V = 1:numb_variations
combo_VAR_unique = unique(ComboValue(:,V));
.
.
.
the size of numb_variations == 5 and ComboValue 288*1, when the V = 1, the code is running well but in the second loop when is V becomes 2, I have the error.
@Jan, slight typo, it's size(ComboValue, 2) that matters.
@saman, you state yourself that ComboValue has only one column, hence V, the index you use for the columns, cannot be greater than 1.
If numb_variations is 5, then your ComboValue needs to have at least 5 columns.
Thanks, @Guillaume and @Jan. exactly, the problem was the size of ComboValue. :-)
@Guillaume: Thanks, I've fixed the typo.
You are a gentle person with respect for the questions of the OPs.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Gefragt:

am 11 Jul. 2018

Kommentiert:

Jan
am 11 Jul. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by