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

1 visualización (últimos 30 días)
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.

Respuestas (1)

Suman
Suman el 27 de Sept. de 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)".

Categorías

Más información sobre LTE Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by