Handle References and Structure

2 views (last 30 days)
David
David on 15 Apr 2014
Commented: Walter Roberson on 15 Apr 2014
I am trying to decode a script someone else wrote. I am getting a "bad cell reference" error message on the following:
handles.r = handles.NonNaNIndices{handles.IntTable,1}(handles.loop,1);
Any help or direction is appreciated.

Accepted Answer

David
David on 15 Apr 2014
K>> class(handles)
ans =
struct
K>> class(handles.NonNaNIndices)
ans =
cell
K>> size(handles.NonNaNIndices)
ans =
2 1
Thanks.
  3 Comments
David
David on 15 Apr 2014
K>> handles.IntTable
ans =
1
2
Walter Roberson
Walter Roberson on 15 Apr 2014
Because your IntTable has multiple entries, your
handles.NonNaNIndices{handles.IntTable,1}
is expanding to multiple outputs, and you are then trying to use () indexing on those multiple elements; you can only use () indexing if the {} expression expands to a single element. You need to decide what output you want in this situation.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 15 Apr 2014
At the command line give the command
dbstop if error
and then run the program. When it stops, please show
class(handles)
class(handles.NonNaNIndices)
size(handles.NonNaNIndices)

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!