Subscripting into an mxArray is not supported. Cell contents reference from a non-cell array object.

1 visualizzazione (ultimi 30 giorni)
I have a Simulink model, there is a MATLAB function CodeBlockSegment. In this function I call the lteCodeBlockSegment function (from LTE Toolbox), which returns the result as a cell array with int8 column vector elements (the size of the vectors changes depending on the input data). I need to get separately each vector that is a subset of the cell array.
I have already tried all possible solutions to the problem from the Internet, but I constantly get various errors. That being said, the same code runs well in a simple matlab .m file.
function segm = CodeBlockSegment(in,num)
coder.extrinsic('lteCodeBlockSegment','cell2mat','cell2table');
cbs1 = lteCodeBlockSegment(in);
tf = iscell(cbs1);%result - 1 ( returns 1 (true) if A is a cell array. Otherwise, it returns 0 (false).)
segm=cbs1{1}; %Cell contents reference from a non-cell array object.
%d = cell2mat(cbs1);
%segm=d(1,1); %Subscripting into an mxArray is not supported.

Risposte (1)

Suman
Suman il 27 Set 2024
Hi Añ An,
The error "Cell contents reference from a non-cell array object." means that the variable "cbs1" is not a cell array. Try using parentheses instead, "cbs1(1)".

Categorie

Scopri di più su LTE Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by