MATLAB Answers

Cell contents reference from a non-cell array object.

2 views (last 30 days)
Mira le
Mira le on 17 Dec 2019
Commented: Adam Danz on 18 Dec 2019
why this error appear "Cell contents reference from a non-cell array object"
U = {} at first
U = TI(s).Si;
TI is strict and Si is a field of TI of cell class
sitem = unique([U{:}]);

  9 Comments

Show 6 older comments
Adam Danz
Adam Danz on 17 Dec 2019
If TI(s).Si isn't a cell, then U won't be a cell, even if you initialize it as a cell
U = {};
U = TI(s).Si; % you're just overwriting U here
If you use Geoff's suggestions, U will remain as cell.
U = {};
U{1} = TI(s).Si;
Adam Danz
Adam Danz on 18 Dec 2019
I don't know what your code does. I saw your comment, "for example TI(1).Si= {2 3}" which indicates that Si is a cell array but is that always true? Maybe it is; I don't know.

Sign in to comment.

Answers (0)

Tags

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!