Error using sub2ind: out of range subscript
6 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am running a matlab gui and when I load the data (multitiff file) and display it in the axes I get the following error. I don't know how to proceed because the error doesn't appear every time I run the code. I tried to check which version of sub2ind maltab is using and it seems to use the correct version. Thank you in advance for your help.
Warning: Error occurred while executing the listener callback for event Action defined for class
matlab.graphics.interaction.graphicscontrol.AxesControl:
Error using sub2ind
Out of range subscript.
Error in matlab.graphics.chart.interaction.dataannotatable.ImageAdaptor/getNearestImageIndex (line 369)
index = sub2ind(dataSize, nRC(1), nRC(2));
Error in matlab.graphics.chart.interaction.dataannotatable.ImageAdaptor/doGetNearestPoint (line 225)
index = getNearestImageIndex(hObj, point_v, basis_row, basis_col);
Error in matlab.graphics.interaction.uiaxes.DataTipsBase
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.DataTipHoverLingerInteraction/handleEvent
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.DataTipBaseInteraction/response
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.InteractionBase/responseevent
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.InteractionBase
Error in matlab.graphics.interaction.graphicscontrol.GenericControl/process
Error in matlab.graphics.interaction.graphicscontrol.layoutable.LayoutableControl/process
Error in matlab.graphics.interaction.graphicscontrol.layoutable.GridLayoutableControl/process
Error in matlab.graphics.interaction.graphicscontrol.AxesControl/process
Error in matlab.graphics.interaction.graphicscontrol.ControlManager/processMessage
> In matlab.graphics.interaction.graphicscontrol/GenericControl/process
In matlab.graphics.interaction.graphicscontrol.layoutable/LayoutableControl/process
In matlab.graphics.interaction.graphicscontrol.layoutable/GridLayoutableControl/process
In matlab.graphics.interaction.graphicscontrol/AxesControl/process
In matlab.graphics.interaction.graphicscontrol/ControlManager/processMessage
2 件のコメント
dpb
2025 年 1 月 9 日
I think you'll have to submit this to official support with the app that causes the error...
You could try setting a breakpoint on error in the callback and see what the indices are at the tme it does fail, but it likely won't be anything you can fix given it's in the base code.
回答 (1 件)
Satwik
2025 年 1 月 16 日
I faced a similar warning message and error while working on a project. This behaviour occured sporadically. It turned out to be a graphics issue. Running the following command in the MATLAB command window before running the project fixed the issue for me:
>> opengl software
The above approach could help resolve the issue in your case as well. For more information on 'opengl', please refer to the following documentation:
I hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Specifying Target for Graphics Output についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!